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.
Author |
Topic |
ppatel112
Starting Member
35 Posts |
Posted - 2013-11-12 : 00:26:19
|
My Query below returns all the data from arsap and the intersection between ARSAP and users tableselect NAMEEMPL from SAMINC.dbo.ARSAP LEFT OUTER JOINdbo.Users ON NAMEEMPL = User_FirstName + ' ' + User_LastName Collate Latin1_General_CI_ASwhat i need to do is to only return the data that is not matched from ARSAP table to users table above.any help will be much appreciated.regards |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-11-12 : 00:42:30
|
[code]select NAMEEMPL from SAMINC.dbo.ARSAP LEFT OUTER JOIN dbo.Users ON NAMEEMPL = User_FirstName + ' ' + User_LastName Collate Latin1_General_CI_ASWHERE User_FirstName IS NULL[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-12 : 01:53:36
|
[code]select NAMEEMPL from SAMINC.dbo.ARSAPWHERE NOT EXISTS (SELECT 1FROM dbo.Users WHERE NAMEEMPL = User_FirstName + ' ' + User_LastName Collate Latin1_General_CI_AS)[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|