其他sql格式也在更新中,可直接查看这个系列,要是没有你需要的格式,可在评论或私信我
讲解:select 1 只要满足条件的就显示1,一般和exists使用,判断里面是否有值,下一章再说exists的用法吧,今天聚餐
select 1 from 的案例
oracle 原sql
select
(select 1
from B b
where b.riskcode = a.riskcode) as Age
from
A a
hive 改sql
select
b.ll as Age
from
A a
right JOIN
(select 1 as ll , riskcode
from B
group by riskcode
) b
on b.riskcode = a.riskcode