If (Choose_Type = 1) Return (AAA) // Final_Value == AAA
If (Choose_Type = 2) Return ( BBB) // Final_Value == BBB
Else Return (0)
Try the SWITCH structure, much like the CASE structure in SQL.
SELECT SWITCH (choose_type = 1,"AAA",choose_type=2,"BBB",choose_type NOT EXISTS ("AAA", "BBB"), 0) AS...