I'd like to be able to set add a field that answers the question "For a value in this record, does that value meet some condition in another table?". I thought I'd try a case-when
with an exists
, but Teradata (my dbms) does not like it. Any recommendations?
select foo,
(case when exists (select x.foo
from somedb x
where x.bar > 0)
then '1' else '0' end) as MyFlag
from mydb