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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query

Author  Topic 

Gayatri D.Patil
Yak Posting Veteran

58 Posts

Posted - 2008-02-15 : 03:08:12
hello sir
i have 3 tables.
1. tAssetMaster---AssetCode P.K, DescriptionShort.
2. tSectorMaster---SectorCode P.K, Description
3. tAssetSectorMap--AssetSectorCode P.K,AssetCode F.K,SectorCode F.K.

tAssetMaster have 1053 records.
tSectorMaster have 27 records
tAssetSectorMap have 1841 records

my query is
select * from tAssetMaster tA,tAssetSectorMap tAS,tSectorMaster tS
where tAS.AssetCode = tA.AssetCode
and tAS.SectorCode= tS.SectorCode
and tAS.SectorCode = 3

Error- 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"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-15 : 04:23:48
quote:
Originally posted by Gayatri D.Patil

hello sir
i have 3 tables.
1. tAssetMaster---AssetCode P.K, DescriptionShort.
2. tSectorMaster---SectorCode P.K, Description
3. tAssetSectorMap--AssetSectorCode P.K,AssetCode F.K,SectorCode F.K.

tAssetMaster have 1053 records.
tSectorMaster have 27 records
tAssetSectorMap have 1841 records

my query is
select * from tAssetMaster tA,tAssetSectorMap tAS,tSectorMaster tS
where tAS.AssetCode = tA.AssetCode
and tAS.SectorCode= tS.SectorCode
and tAS.SectorCode = 3

Error- 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 tA
inner join tAssetSectorMap tAS
on tAS.AssetCode = tA.AssetCode
inner join tSectorMaster tS
on tAS.SectorCode= tS.SectorCode
ans tS.ScetorCode not in (3,4,5)
Go to Top of Page
   

- Advertisement -