Oracle -> Mysql Select Problem
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Oracle -> Mysql Select Problem

  1. #1
    Join Date
    Feb 2003
    Posts
    2

    Question Oracle -> Mysql Select Problem

    I wonder if anyone can help. I am migrating a mysql database to work in oracle.

    This is a scaled down query from the whole query I am trying to run

    SELECT CLIENT.ID, USERADDRESS.FIRSTNAME AS USER_FIRSTNAME, USERADDRESS.LASTNAME AS USER_LASTNAME
    FROM CLIENT
    LEFT OUTER JOIN ADDRESS ON ADDRESS.ID = CLIENT.ADDRESS_ID
    LEFT OUTER JOIN OPERATOR ON OPERATOR.ID = CLIENT.USER_ID
    LEFT OUTER JOIN ADDRESS AS USERADDRESS ON USERADDRESS.ID = OPERATOR.ADDRESS_ID

    Mysql will let you use the same table twice in a join by use alias's.

    Oracle doesnt seem to like it, is there away around this?

    Another problem I have is finding an alternative to the mysql function

    unix_timestamp

    Thanks

    Kev

  2. #2
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Have you tried doing the table alias without the "AS":

    SELECT CLIENT.ID, USERADDRESS.FIRSTNAME AS USER_FIRSTNAME, USERADDRESS.LASTNAME AS USER_LASTNAME
    FROM CLIENT
    LEFT OUTER JOIN ADDRESS ON ADDRESS.ID = CLIENT.ADDRESS_ID
    LEFT OUTER JOIN OPERATOR ON OPERATOR.ID = CLIENT.USER_ID
    LEFT OUTER JOIN ADDRESS USERADDRESS ON USERADDRESS.ID = OPERATOR.ADDRESS_ID

    Just a guess

    Cheers
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: www.oracle-base.com
    My blog: www.oracle-base.com/blog

Posting Permissions

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



Click Here to Expand Forum to Full Width