On 05.02.2008 23:25 CE(S)T, Baron Schwartz wrote:
You can't select from a table you're updating at the same time. What "at the same time" means is a bit unclear unless you're one of the MySQL developers ;-)
Yes, Paul DuBois already replied to me off-list. Now I found that documentation part and understand that MySQL cannot do this. (Haven't tested whether other DBMS can, would be pointless anyway.)
My goal was to copy some potentially large BLOB from one record to another in the same table, nothing more. I have now chosen the way to fetch it from the database and have my application just write it back again. I wanted to avoid this unnecessary copying around.
However, you can do multi-table updates like this: UPDATE tbl AS a INNER JOIN tbl AS b ON .... SET a.col = b.col
That sounds interesting, however, I couldn't find it in PostgreSQL's and SQLite's reference. Is this a MySQL extension over the SQL standard?
-- Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]> Visit my web laboratory at http://beta.unclassified.de -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]