Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Gayatri D.Patil
Yak Posting Veteran
58 Posts |
Posted - 2008-02-15 : 03:08:12
|
| hello siri have 3 tables.1. tAssetMaster---AssetCode P.K, DescriptionShort.2. tSectorMaster---SectorCode P.K, Description3. tAssetSectorMap--AssetSectorCode P.K,AssetCode F.K,SectorCode F.K.tAssetMaster have 1053 records.tSectorMaster have 27 recordstAssetSectorMap have 1841 recordsmy query isselect * from tAssetMaster tA,tAssetSectorMap tAS,tSectorMaster tS where tAS.AssetCode = tA.AssetCode and tAS.SectorCode= tS.SectorCodeand tAS.SectorCode = 3Error- no error but not display 3,4 and 5 sector code.other sector code are display.3,4,5 have 1067 to 1841 assetcode.pls help me.gayatri |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-15 : 04:18:01
|
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx E 12°55'05.25"N 56°04'39.16" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-15 : 04:23:48
|
quote: Originally posted by Gayatri D.Patil hello siri have 3 tables.1. tAssetMaster---AssetCode P.K, DescriptionShort.2. tSectorMaster---SectorCode P.K, Description3. tAssetSectorMap--AssetSectorCode P.K,AssetCode F.K,SectorCode F.K.tAssetMaster have 1053 records.tSectorMaster have 27 recordstAssetSectorMap have 1841 recordsmy query isselect * from tAssetMaster tA,tAssetSectorMap tAS,tSectorMaster tS where tAS.AssetCode = tA.AssetCode and tAS.SectorCode= tS.SectorCodeand tAS.SectorCode = 3Error- no error but not display 3,4 and 5 sector code.other sector code are display.3,4,5 have 1067 to 1841 assetcode.pls help me.gayatri
Try:-select * from tAssetMaster tAinner join tAssetSectorMap tASon tAS.AssetCode = tA.AssetCode inner join tSectorMaster tS on tAS.SectorCode= tS.SectorCodeans tS.ScetorCode not in (3,4,5) |
 |
|
|
|
|
|
|
|