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 |
fm88
Starting Member
18 Posts |
Posted - 2008-05-19 : 01:11:24
|
I have 2 tables,tblProjIDEst and tblProjIDAct.Both contain "projectID" field.I want to select the "projectID"s that are found in the first table and not in the second.For example if first table contains 1-2-3-4-5 and the second1-2.I want to select 3-4-5.Can someone help me in writing this query?Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-19 : 01:30:21
|
SELECT projectIDFROM tblProjIDAct paLEFT JOIN tblProjIDEst peON pe.projectID=pa.projectIDWHERE pe.projectID IS NULL |
 |
|
fm88
Starting Member
18 Posts |
Posted - 2008-05-19 : 02:35:03
|
Well,its not workin..am I missing some information to check.Initially both tables are empty with no data.Its giving "Ambiguous column name projectID"...In both tables this column exists with the same design. nvarchar(20)any help is appreciated! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-19 : 02:45:06
|
Posted - 05/19/2008 : 01:30:21 -------------------------------------------------------------------------------- SELECT pa.projectIDFROM tblProjIDAct paLEFT JOIN tblProjIDEst peON pe.projectID=pa.projectIDWHERE pe.projectID IS NULL |
 |
|
|
|
|