I am no expert in sql, but I keep stubbling on this problem:
I have a table t1 with 2 columns (a,b)
I have a table t2 with 2 columns (c,d)
I need to delete all records from t1 which have the same value (a,b)
than the value of (c,d) in all records in the t2 table.
I oracle, this is simple:
delete from t1
where (a,b) in (select c,d from t2)
because Oracle has support for this syntax. Dont remember how they call
it. But this is not support in sql server. So I have to resort to:
delete from t1
where a + '+' + b in ( select c + '+' + d from t2)
Of course, a,b,c,d must be varchar for this to work. Basically I fake a
unique key for the records. Is there a better way to do this?
Thanks