postgressql

查询定义变量

set session "myapp.user" =1;
SELECT current_setting('myapp.user')

 

 

判断
SELECT (CASE
WHEN (1 <= 100) THEN sum(ordinary_price)
WHEN (1 >= 200) THEN sum(ordinary_price)
WHEN (1 >= 200) THEN sum(ordinary_price)
ELSE sum(ordinary_price)
END) as ii
FROM pro_product

posted @ 2019-07-16 13:57  玉雄观真  阅读(155)  评论(0编辑  收藏  举报