I have this problem, I have a table product
like this with two columns target
and actual
, how can I build a query and tell it : if target == '' then select from actual
. To be clearer, this is my table product
with the two columns :
actual | target
---------------
p12 | <null>
p14 | h20
p16 | <null>
p16 | <null>
p16 | <null>
p16 | <null>
p16 | <null>
So I would like to select for example a value 'xx', how can I build this condition in SQLAlchemy (or sql) telling it to look for it in column target
but if the cell is empty (is null) then look for it inside the actual
column cell.
Is this possible?