'FROM reallyReallyLongTableName AS a' syntax?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #1

    'FROM reallyReallyLongTableName AS a' syntax?

    I have a really long query, something like this:[code=sql]SELECT reallyReallyLon gTableName.id, reallyInsanelyL ongTableName.id
    FROM reallyReallyLon gTableName, reallyInsanelyL ongTableName
    WHERE reallyReallyLon gTableName.id = reallyInsanelyL ongTableName.id[/code]Except this is kind of pointless, obviously. The real query is much longer, but mostly because the tablenames are so long. Isn't there a way to give it an alias like this:[code=sql]SELECT a.id, b.id
    FROM reallyReallyLon gTableName AS a, reallyInsanelyL ongTableName AS b
    WHERE a.id = b.id[/code]I thought there was something like this, but I can't get this syntax to work. Obviously I can do AS a in the fieldnames portion, that isn't a problem, but in the tables?

    Jared
  • BHTanna
    New Member
    • Aug 2008
    • 31

    #2
    U can use alias.. But without AS.

    Like

    <tablename> <alias>

    eg.

    reallyReallyLon gTableName a, reallyInsanelyL ongTableName b


    Hope this will work.

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      Thank you! that worked just fine!

      Jared

      Comment

      Working...