Aggregate column comparison in sql server sql ?
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
.
Relevant Pages
- Re: Oracle licence question
... What you mean - they use portable SQL as definied by the ANSI SQL standard, ... and every support call costing an arm and a leg. ... One thing you need to watch is staffing, costs for Oracle staff here in the ... no added cost in the database - and that duplication has cost, ... (comp.databases.oracle.server) - Re: Thoughts on MF COBOL, Unix, and RDBMS
... COBOL compiler available but it doesn't support SQL, ... It does support SQL, either through the MF-supported OpenESQL precompiler or the Oracle ... You can talk through ODBC or OCI (Oracle Call ... (comp.lang.cobol) - Re: Problem setting up Oracle -> SQL dts task
... I think Oracle client is also necessary and MDAC shall be updated for this ... Microsoft Online Partner Support ... SQL Distributed Query with Oracle Needs Oracle ... Microsoft Product Support Services. ... (microsoft.public.sqlserver.dts) - Re: Import problems on Windows Server
... Because the competitor used stuff, undocumented stuff, they weren't suppose to. ... both the Microsoft ODBC Driver and OLE DB Provider support Oracle 8i with the following limitations:. ... Returning multiple resultsets from a stored procedure or batch SQL statement is not supported using ADO or OLEDB. ... (comp.databases.oracle.server) - Re: Import problems on Windows Server
... Because the competitor used stuff, undocumented stuff, they weren't suppose to. ... both the Microsoft ODBC Driver and OLE DB Provider support Oracle 8i with the following limitations:. ... Returning multiple resultsets from a stored procedure or batch SQL statement is not supported using ADO or OLEDB. ... (comp.databases.oracle.server) |
|