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 2005 Forums
 Transact-SQL (2005)
 Query question

Author  Topic 

Benny57
Starting Member

4 Posts

Posted - 2012-06-15 : 05:12:19
Hi!

I am new to this, so i need some help with a query.
I have 2 tables
table 1 with people that have signe up for some thing
table 2 with people that showed up.

I want an answer that show me who of the people that signed up in table 1 and did not showed up in table 2.
Any one that can help me with that?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-15 : 05:38:41
select *
from table1
where personid not in (select personid from table2)

select *
frrom table1 t1
left join table2 t2
on t1.personid = t2.personid
where t2.personid is null


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Benny57
Starting Member

4 Posts

Posted - 2012-06-15 : 06:24:10
Thank's nigelrivett, works fine
Go to Top of Page
   

- Advertisement -