Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
None
-
None
-
None
-
None
-
Windows 7
Description
I ran the following SQL query:
update image set image.isMain=1 where not exists (
select * from image i2 where image.article_id=i2.article_id and image.id < i2.id)
I receive the following error message:
SQL Error (1093): Table 'image' is specified twice, both as a target for 'UPDATE' and as a separate source for data
It is perfectly valid (and often necessary, as in this case) to specify a table twice in this way. This query should work and not return an error.