Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

IADaveMark

MySQL problem with aliased joins to the same table.

This topic is 5891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone know if MySQL doesn''t support aliasing a join back to the same table? Example: Select Table1.Field1, Alias1.Field1 from ((Table1 INNER JOIN Table1 AS Alias1 ON ... It gives me an error "near" the INNER JOIN above. Dave Mark President and Lead Designer Intrinsic Algorithm Development "Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
Advertisement
Read The Fine Manual. Unless you are using an old version of MySQL you'll probably just need to modify your query syntax somewhat to make it work. MySQL syntax (and limitations) take some getting used to...


[edited by - spock on June 27, 2002 8:31:15 PM]

Share this post


Link to post
Share on other sites
Fantastic answer... but I DID read it and all it told me was that aliases work just fine. In fact, after further testing with a simplified query, I got that part to work... it''s just when I have more than one other table being referenced that it starts to choke.

Dave Mark
President and Lead Designer
Intrinsic Algorithm Development

"Reducing the world to mathematical equations!"

Share this post


Link to post
Share on other sites
OK - I didn''t mean to offend you, just trying to make sure you had RTFM. Your example seemed simple enough that it should work given MySQL-friendly syntax, but if what you''re trying to do involves several tables/joins it is indeed easy to stumble upon one of many frustrating limitations. I''ve struggled with MySQL myself so I know what a pain it can be (it''s getting better though).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!