----字符串分割做表
----这个函数好,很对我胃口,例如复数店铺查询的时候
drop table if exists a;select regexp_split_to_table('57:67:157:158:178', E'\:+')
into temp table a;
select * from a;
------字符串分割
select Split_part('57:67:157:158:178',':',4)
----相当于 inner join
----从这个例子上看返回3和5的数据
select * from DB.SHEMA.TABLE where Field in(3,5,7)
INTERSECT
select * from DB.SHEMA.TABLE where Field in (3,4,5)
----相当于 left join + where Field is not null
----从这个例子上看返回7的数据
select * from DB.SHEMA.TABLE where Field in(3,5,7)
EXCEPT
select * from DB.SHEMA.TABLE where Field in (3,4,5)
----MSSQL 和POSTGRESQL的差别
[NOT EXISTS | NOT IN ] → LEFT OUTER JOIN + WHERE Field IS NULL