SQL statement:
Copy codeThe Code is as follows: update item I, resource_library r, resource_review_link l set I. name = CONCAT ('review: ', r. resource_name) where I. item_id = l. instance_id
And l. level = 'item' and r. resource_id = l. resource_id and I. name =''
Join update & JOIN DELETECopy codeThe Code is as follows: update
Set a. schoolname = B. schoolname
From tb_Std as a join tb_Sch as B on a. School = B. School
Where a. std_year = 2005
Go
/*
(2 row (s) affected)
*/
Select *
From tb_Std as a join tb_Sch as B on a. School = B. School
/*
A School
2 2005 A School
3 2004 c a School C School
4 2005 D School
(4 row (s) affected)
*/
Copy codeThe Code is as follows: delete
From table1 a, table2 B
Where a. col1 = B. col1
And a. col2 = B. col2
The above SQL statement runs fine in SQL Server.
If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that wocould be really helpful.
> Hi,
>
> Is the following delete statement possible in Oracle 9i.
>
> Delete
> From table1 a, table2 B
> Where a. col1 = B. col1
> And a. col2 = B. col2
>
> The above SQL statement runs fine in SQL Server.
>
> If the Oracle 9i has different syntax or if there is any other way to accomplish this with a single delete statement that wocould be really helpful.
>
> Thanx in advance.
>
>-Bheem
Bheem,
Try this:
Delete from table1 a where exists (select 1 from table2 B
Where a. col1 = B. col1 and a. col2 = B. col2 );
Hope this helps,
Tom K.