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 |
|
eembme
Starting Member
18 Posts |
Posted - 2007-09-26 : 14:11:46
|
| I have 2 tables, table one with 772 pieces of compliant data. Table 2 has 435 pieces of data that meet another criteria (all the columns are identical it was just passes through an additional filter). I need to capture the values that are excluded from table 2.Example Table 1ID some value1 x2 x3 x4 x5 xTable 2ID some value2 x3 x5 xI need to capture the data from ID 1 and 4 and assign a new value to it, it is extra compliant data. Thanks! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-26 : 14:14:49
|
SELECT t1.ID, t1.SomeValueFROM Table1 AS t1LEFT JOIN Table2 AS t2 ON t2.ID = t1.IDWHERE t2.ID IS NULL E 12°55'05.25"N 56°04'39.16" |
 |
|
|
eembme
Starting Member
18 Posts |
Posted - 2007-09-26 : 14:45:29
|
| Thanks so much! I was stuck on that.My code is posted below in case any else has this problemSELECT [all compliance].[Patient ID],[all compliance].Datetime FROM [all compliance] LEFT JOIN [filtered 2] ON [filtered 2].Datetime = [all compliance].DatetimeWHERE [filtered 2].Datetime IS NULLORDER BY [Patient ID], [Datetime] |
 |
|
|
|
|
|