I have 2 tables in my database (Main, Decode)
In decode table there are 2 col's 1 contain Abbriviate (code) and other contains Orginal text.
Code Orginal
A Tree
B Shrub
C Herb
D Climber
E Ground cover
Main table is the table I add data in Abbriviated (short form) format.
basically it is like this (over 30 columns> ID species Genus Habitate Ecosystem Flowercolor)
ID Habitat
01 B
02 C
03 A
04 E
05 A
06 A
07 E
I try to use below query to retrive orginal (Tree, Shrub,...) words insted of Abbriviates (A, B, C, ) As a column called "List" (As List)
SELECT Sinhala1 AS Sinhala, English1 AS English, Switch(Main.Habitat='Decode.code','Decode.Orginal' ) AS List
FROM Main
WHERE Main.Habitat = Decode.Code
It's not working , Pls help