I want to pull an SQL statement so that one column (not present in the second table) is conditionally filled based on table source.
Table1
joinid
flag1
cond1
cond2
date
Table2
joinid
flag2
cond2
date
I would like the output to be:
flag1,flag2,cond1,cond2
where cond1 is always 600 for results from table2.
there is a condition that the date must be in a specific range.
Psuedo Ex:
SELECT flag1,flag2,IF tablesource=table1 then cond1 else 600 AS cond1,cond2
FROM table1
WHERE date IN (date1,date2,date3, etc)
LEFT JOIN table2 on table1.joinid=table2.joinid