I want to select one row with a value 'us-en' if it exists and the row 'us' if the previous row does not exist.
The query goes a bit like this :
----Code:SELECT t1.a, t1.b, t2.a, t2.b FROM t1,t2 WHERE t1.a = t2.a AND t2.b = 'us-en' OR t2.b = 'us' ORDER BY t1.b DESC
wich returns both rows. I would like MySQL to return just one row based on the existence of a row that contains 'us-en'.
"Group by" does not seem to be the right solution.
Can you help me?
Thanks a lot.