Can any one explain this query behavior

Giganews Newsgroups
Subject: Can any one explain this query behavior
Posted by:  pai (grpa…@yahoo.com)
Date: 23 Aug 2006

db_TBO                    db_TBT
-----------------------------
--------------------------------------------------------
TBOID      |     Date            TBTID    |     TBOID    |     Date
----------------------------        ---------------------------------------------------------
rp01        |      01/08/2006      ap01          |    rp01    |    02/08/2006
many rows                ap02        |     rp01       |    05/08/2006
                      ap03          |    rp03    |    04/08/2006

I want to find TBTTD field of table db_TBT
who have of db_TBO date > db_TBT table date
and TBOID should be 'rp01' of both tables

when I give a query as it works as I needed

Select TBT.Date
from db_TBO TBO , db_TBT TBT
where TBT.TBOID = 'rp01'
and TBO.TBOID ='rp01'
and TBO.Date > TBT.Date

My doubt is when I run the following query
" Select TBT.Date from db_TBO TBO , db_TBT TBT where TBT.TBOID = 'rp01'
"
it gives me more than 7 records

when I run the query using some change
" Select TBT.Date , TBT.TBID from db_TBO TBO , db_TBT TBT where
TBT.TBOID = 'rp01' "
it gives more rows than previous row

Can u give me any explations.

Thanks
Pai

Replies