Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exclude records if exist in abandoned table? 1

Status
Not open for further replies.
Joined
Jun 29, 2001
Messages
195
Location
US
I'm exporting a table but I want to exclude certain records if they exist in my Abandoned table. What would SQL syntax be?

Thanks. Ashley L Rickards
SQL DBA
 
One way to do it is like this. The RecID would be replaced with the column or columns that define the relationship between the tables.

Select a.*
From TblName As t
Left Join Abandoned As a
On t.RecID=a.RecID
Where a.RecID Is Null Terry L. Broadbent
Programming and Computing Resources
 
Thanks Terry, I'll give a try. Ashley L Rickards
SQL DBA
 
this is the statement I used and worked perfectly. Thanks again.


SELECT t.*
FROM dbo.Targus_Return t LEFT OUTER JOIN
EIC_ADMIN.TargusAbandoned a ON t.CallId = a.Callid
WHERE (a.Callid IS NULL) AND (t.Status = '2') OR
(t.Status = '3')
Ashley L Rickards
SQL DBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top