You are here: Can any one explain this query behavior « MsSQL Server « IT news, forums, messages
Can any one explain this query behavior

Posted by pai on 10/02/61 11:56

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация