to quote the manual:

Currently, you cannot delete from a table and select from the same table in a subquery.

mysql> select * from paths where id>=(select max(ppathref) from paths);
+--------+---------+------------+----------+
| id     | typeref | name       | ppathref |
+--------+---------+------------+----------+
| 216883 |       1 | shared     |   216882 |
| 216884 |       1 | shared.bs  |   216883 |
| 216885 |       1 | shared.so  |   216883 |
| 216886 |       1 | threads.bs |   216882 |
| 216887 |       1 | threads.so |   216882 |
+--------+---------+------------+----------+
5 rows in set (0.00 sec)

mysql> delete from paths where id>=(select max(ppathref) from paths);
ERROR 1093 (HY000): You can't specify target table 'paths' for update in FROM 
clause

Server version:         4.1.14-standard-log


Are there any workarounds?


Any ideas? TIA

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (443) 921-0381                 Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to