MySQL Forums
Forum List  »  Newbie

What is the most efficient way to do this?
Posted by: Wim Roffel
Date: November 22, 2016 05:53AM

I have two tables: product and product_lang
product contains the fields: id, price and reference
product_lang contains the fields: id, lang and name.

Now I want to get a complete list of product names. The simple way to do this would be something like "select id,name from product_lang where id=myid and lang=mylang".

The complication is that I am not guaranteed that there is an entry for my language for this product. In that case I want to get the name in whatever other language that is available.

I always end up with quite complicated contraptions to do this. So my question is: what is the most elegant, simple and fastest way to do this.

Options: ReplyQuote


Subject
Written By
Posted
What is the most efficient way to do this?
November 22, 2016 05:53AM


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.