MySQL Forums
Forum List  »  Newbie

Re: How to model an i18n table and how to query it
Posted by: Aziz
Date: July 23, 2005 09:02AM

I found that I was mistaken about the restriction of having sub-selects in a LEFT JOIN clause. When I first tried to do this I had probably forgotten to define the ON part of the LEFT JOIN statement, which resulted in an error. So here's the improved version of the self-join query:

[sql]
SELECT en.IN_ID, en.resource AS en, de.resource AS de, ur.resource AS ur
FROM (SELECT IN_ID, resource FROM i18n WHERE lang='en') as en
LEFT JOIN (SELECT IN_ID, resource FROM i18n WHERE lang='de') as de ON en.IN_ID=de.IN_ID
LEFT JOIN (SELECT IN_ID, resource FROM i18n WHERE lang='ur') as ur ON en.IN_ID=ur.IN_ID
[/sql]

I'm still interested in what you think about this whole issue. What can be done much better or different? Your comments and ideas are highly appreciated.

Regards,
Aziz

Options: ReplyQuote


Subject
Written By
Posted
Re: How to model an i18n table and how to query it
July 23, 2005 09:02AM
July 26, 2005 11:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.