![](/img/trans.png)
[英]How to write where condition in postgres-flask for dynamic values
[英]mysql query - How to write if condition on where
我有查询要检查close_at> = '00:00'+间隔1天,否则不添加间隔。 我的查询是:
从表中选择*,其中now()在open_at和if之间(close_at> = '00:00'close_at + INTERVAL 1天,close_at-INTERVAL 1天)
在where条件下,您可以根据业务逻辑编写case条件。
SELECT id
, naam
FROM klanten
WHERE IF('close_at'> = '00:00''close_at'+间隔1天,'close_at'-间隔1天)像'某种情况'
结构是这样的,但我不知道什么是常量或属性,请正确使用简单的引号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.