Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not in with multiple field
Message
 
 
To
08/07/2003 14:14:44
David Brunelle
Université de Sherbrooke
Sherbrooke, Quebec, Canada
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00808135
Message ID:
00808141
Views:
12
If ID fields are of charchter type, you can concatenate them directly. Otherwise you'll have to convert them to chrackter type before concatination using CAST or CONVER functions.
Select * from Test where ID + ID2 + ID3 + ID4 not in (Select distinct ID + ID2 + ID3 + ID4 from site)
>Hi,
> I want to do an update of my database to add fields only if the set of field (4 field ) are not found . With one field you can do
> Select * from Test where ID not in (Select distinct ID from site) and it would return all ID that are not in the table.. How do you that with 4 fields (a sort of Select * from Test where ID,ID2,ID3,ID4 not in (Select distinct ID,ID2,ID3,ID4 from site). None of these field are primary key though. (one table is only a list of all existing element and the other one the actual table I want to update, but the primary key for this table is a automatically assigned number).
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform