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)
 Query Problem

Author  Topic 

mattastic
Starting Member

15 Posts

Posted - 2004-12-02 : 05:41:43
Hi,
I have 2 tables in my database, all I need to do is select all records from one database that dont exist in the other.

The problem is I get repeating records, can anybody help?

Here is my sql:

SELECT * FROM personaldetails INNER JOIN dbo.ql ON personalDetails.applicationID = dbo.ql.applicationID
WHERE ( personaldetails.applicationid <> ql.applicationid
) ORDER BY personaldetails.applicationid DESC

venkatarajan
Starting Member

6 Posts

Posted - 2004-12-02 : 06:54:32
Hai,
I hope this may work.
SELECT * FROM personaldetails where personalDetails.applicationID not in
( SELECT ql.applicationid FROM ql) ORDER BY personalDetails.applicationID

regards,
Venkatarajan

Expect the Worst,
Hope for the Best
Go to Top of Page

mattastic
Starting Member

15 Posts

Posted - 2004-12-02 : 07:00:57
Thankyou that works great!
Go to Top of Page
   

- Advertisement -