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