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 |
|
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,VenkatarajanExpect the Worst,Hope for the Best |
 |
|
|
mattastic
Starting Member
15 Posts |
Posted - 2004-12-02 : 07:00:57
|
| Thankyou that works great! |
 |
|
|
|
|
|