I have a column which needs to be populated with ture/false/(N/A) data. This column is part of a select statement
So, How can i achieve this?
SELECT distinct
program_id,
prog_name,
Eitc_Active_Switch as Prog_Status,
progmap.client_id,
progmap.ORG_ID,
sec.calwinexists_ind as interface,
sec.Client_name
FROM ref_programs prog (nolock)
LEFT OUTER JOIN ref_county_program_map progmap (nolock)
ON progmap.program_id=prog.prog_id AND progmap.CLIENT_ID=prog.CLIENT_ID
INNER join sec_clients sec (nolock)
on sec.client_id=progmap.Client_id
‘sec.calwinexists_ind as interface’ is the column. the true/false should be displayed for only three records (AMC, AMBD, ACMNI) and ‘N/A’
for the rest of the records
Can anyone help me?
You should use CASE expression.
Example:
And in this way you should adapt your query to match your needs.