Table A
Id Name
1 Apple
2 Mango
3 Banana
Table B
Id Locale Name_In_Lang
1 es-ES Apple[Spanish]
1 it-IT Apple[Italian]
2 it-IT Mango[Italian]
Let us say if the user requested spanish versions then the query should return all the spanish [es-ES] verions from Table B for every record in Table A. If the spanish version is not available then simply return the corresponding record from Table A
The output should look something like -
Id Locale Name
1 es-ES Apple[Spanish]
2 Mango
3 Banana
Any suggestions on how to achieve it with and without using union?