SQL on and where

mac2025-12-18  7

select distinct a.pro_id,a.pro_ip,b.name from

(select distinct pro_id,pro_ip from table2)a

inner join

(select distinct id,name from table1

where ds = "${bizdate}"

)b

on a.pro_id = b.id

-- where name is not null  为什么这里不能加where?

不加where可以正确获取数据,加了就是空值

最新回复(0)