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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 display

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2006-12-13 : 02:08:36
hi fys,
master table
lnno code value
1 30 general
1 42 csd
2 142 chennai
2 143 madurai

gworker table
idno name unitcode citycode
4012 sen 30 142
4013 uma 42 143
4014 xx 142 142

my code is:
select code,value from master where code in(
select distinct(unitcode), from gworker
select distinct(citycode) from gworker
)

just i need code,value from master without using join

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-13 : 03:09:34
select code, value from master where code in (select unitcode from gworker union all select citycode from gworker)

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -