【发布时间】:2023-12-31 09:08:01
【问题描述】:
我只想退回拥有所有活动帐户的经理。在这种情况下,我希望返回简和她的三个帐户和数据行。
select *
from [Table1] t1
left join [Table2] t2
on t1.account = t2.account
where lower(t1.flag)='y'
and not exists (select 1 from [Table1] tt1 where tt1.account=t1.account and tti.flag in ('NULL','n'))
我的例外回报必须是: Expected Return Data
【问题讨论】:
-
源表中的数据是什么?
-
数据中的NULL是字符串
'NULL'还是空值? -
String NULL 不幸的是@mik
-
这就是我使用 'NULL' @mik 的原因
标签: mysql sql group-by not-exists appian