Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    26

    Unanswered: Sub Query In Mysql

    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

  2. #2
    Join Date
    Oct 2003
    Location
    Denver, Colorado
    Posts
    137

    Re: Sub Query In Mysql

    How about:

    SELECT @userid:=ID FROM USER WHERE U_NAME='XXX';
    UPDATE DEPARTMENT SET CREATED = @userid, MODIFIED = @userid
    WHERE NAME IN ('00A', 'OOB', 'OOC');

    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

  3. #3
    Join Date
    Sep 2003
    Posts
    26
    Thanks AUS
    It is working !!!

    -RAVI

  4. #4
    Join Date
    Oct 2003
    Location
    Denver, Colorado
    Posts
    137
    Glad to help
    Originally posted by ravishankar
    Thanks AUS
    It is working !!!

    -RAVI

  5. #5
    Join Date
    Nov 2003
    Posts
    1
    really?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •