postgresql 一种比较个性的 sql 写法

今天看到 postgresql 一种比较个性的 sql 写法,如下:

select em.* 
from ( VALUES (4,'INSERT'::text), (8,'DELETE'::text), (16,'UPDATE'::text)) em(num, text)
where 1=1
  and em.num = 4
;
posted @ 2018-08-08 13:59  peiybpeiyb  阅读(230)  评论(0编辑  收藏  举报