I have table element_types
with column element_type
containing amount types Basic Salary
and Housing Allowance
, i want to produce 2 column, one for Basic Salary
and another for Housing Allowance
, these types are linked to another table like employees and the values for those types ..etc, so I want to make 2 separate columns and not displaying types and amounts in rows.
SELECT .....,
(SELECT element_name
FROM pay_element_types_tl
WHERE element_name IN ('Basic Salary')) Salary,
(SELECT element_name
FROM pay_element_types_tl
WHERE element_name IN ('Housing Allowance')) Housing
this gives error
single-row subquery returns multiple rows
how can I achieve what I want?
i've tried to use multi-rows subquery using where
but i want more than a column with different names derived from the same column