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)
 2 column check

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2002-05-03 : 05:06:53


hi i was look for something in sql which can do like this

select * from bill where (owner,id) in (select distinct owner,id from calls)

thanks gurus...

======================================
Ask to your self before u ask someone

jackstow
Posting Yak Master

160 Posts

Posted - 2002-05-03 : 05:25:45
This might do the trick;

select distinct bill.*
from bill
inner join
calls on
bill.id = calls.id
where
calls.owner is not null
and
calls.id is not null








Edited by - jackstow on 05/03/2002 05:30:03
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2002-05-03 : 06:39:38


thanks jackstow

not clear how does it works....

calls.owner is not null and
calls.id is not null

does not mean calls.owner=bill.owner


======================================
Ask to your self before u ask someone
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-03 : 07:44:44
SELECT DISTINCT bill.*
FROM bill
INNER JOIN calls ON bill.id = calls.id
AND bill.owner = calls.owner


Go to Top of Page
   

- Advertisement -