【发布时间】:2022-11-04 17:29:50
【问题描述】:
我正在寻找构建一个过滤器组件,其中
我的搜索就像b_cycle_type = '1st Day Of The Month'
并且在数据库中b_cycle_type 存储为 -1,0,1,2,3,4,5
如何准备 postgres 声明
我在尝试:
SELECT "customers".*
FROM "customers"
WHERE (CASE customers.b_cycle_type
WHEN -1 THEN 'Last day of the month'
WHEN 0 THEN 'Align with first'
ELSE to_char(customers.b_cycle_type, '99th') || ' Day Of The Month'
END = '27th Day Of The Month')
它没有返回任何结果。
【问题讨论】: