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
 finding the difference between these to tables

Author  Topic 

Brandi
Starting Member

1 Post

Posted - 2010-02-25 : 16:42:46
Select lastname, firstname, personid
From [identity] i

Select lastname, firstname, grade, timestamp, role, name
From [identity] i
Inner Join enrollment e on e.personid = i.personid
Inner Join BehaviorRole b on b.personid = i.personid
Inner Join BehaviorEvent be on be.eventid = b.eventid
where active = '1' and residentSchool = '1501004' and enddate is NULL and grade = '05' and [timestamp] >= '2009-08-01 01:53:00.000' and role = 'offender'
Order by grade

I have these two tables and I need to find the difference between the two. I need to find out who does not have a behaveior role or Behavior event out of all the people. Thank you,

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-02-26 : 01:38:42
Use left join instead of inner join and check for null

Vabhav T
Go to Top of Page
   

- Advertisement -