Home » RDBMS Server » Server Administration » delete stmt.
delete stmt. [message #59457] Sat, 22 November 2003 07:07 Go to next message
Kapil
Messages: 145
Registered: May 2002
Senior Member
when i tried as follows

SQL> select a.id from tst a, tst1 b where a.id=b.id;

ID
----------
1009
1120
1234
5599
6789
7860

6 rows selected.

SQL> delete from tst a, tst1 b where a.id=b.id;
delete from tst a, tst1 b where a.id=b.id
*
ERROR at line 1:
ORA-00933: SQL command not properly ended

SQL> delete from tst a where a.id in (select id from tst1);

6 rows deleted.

why cannot i do (delete from tst a, tst1 b where a.id=b.id;) when i can do (select a.id from tst a, tst1 b where a.id=b.id;)
the reason why i want to do (delete from tst a, tst1 b where a.id=b.id;) becoz if i do (delete from tst a where a.id in (select id from tst1);) based on 10 tables, i am running out of temp space. how should i do this now.
Re: delete stmt. [message #59463 is a reply to message #59457] Mon, 24 November 2003 04:30 Go to previous message
Daljit Singh
Messages: 290
Registered: October 2003
Location: Texas
Senior Member
Hi,

Well in select u can select records from multiple tables in one action but in the case of delete or update u can't refer more than one table in ur query thats the reason y u couldn't perform ur first delete statement. In second one u r referring only one table and that one is running fine.
Previous Topic: a question
Next Topic: Cloning a database
Goto Forum:
  


Current Time: Fri Sep 20 08:22:03 CDT 2024