I am attempting to write a query which will retrieve records from the same table with different conditions and present the results in a flattened format as below:
Desired Result
ID, Word, Translation_From_Region_1007, Translation_From_Region_1006
1, Word1, Test 1, Test 2
2, Word2, Test 3, Test 4
The psuedo-code for my query is below, however I'm not entirely sure how to flatten out the results to display my desired result:
SELECT Words.ID, Words.Word, Translation
FROM Words WHERE RegionId=1007
UNION
SELECT Words.ID, Words.Word, Translation
FROM Words WHERE RegionId=1006
Group by Word (as I only want one instance of the word itself with its respective translations flattened.
If anybody can give me any advice or suggest a better way to do this, I'd be very grateful.