我需要将下面的sql代码转换为pysparkDataframe代码,而不是spark.sql('code')代码。
select * from table1 where
(
case when clm1 in ('R','C', 'F') then l=1
when clm1 in ('8','8-B')
and (select coalesce(max (code),0) from table2 where clm2 = "XXX') = 0 then 1=2
else 1=2 end)
如何在where条件下使用case条件。。。
1条答案
按热度按时间bfhwhh0e1#
假设上面是工作查询-