How about
:
SELECT @userid:=ID FROM USER WHERE U_NAME='XXX';
UPDATE DEPARTMENT SET CREATED = @userid, MODIFIED = @userid
WHERE NAME IN ('00A', 'OOB', 'OOC');
Quote:
Originally posted by ravishankar
HI ALL :
Please not that I am trying to convert this oracle specific query to mysql but as I am using MySQL 4.0 where sub queries are not supported facing difficulty can any one suggest some equivalent MySQL query ?
update DEPARTMENT
set
CREATED = (select ID from USER where U_NAME='XXX'),
MODIFIED = (select ID from USER where U_NAME='XXX')
where
NAME in ( '00A', 'OOB', 'OOC') ;
thanks in advance
-Ravi
|