选择查询中单个 IF 中的多个条件 [英] Multiple condition in a single IF in select query

查看:39
本文介绍了选择查询中单个 IF 中的多个条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SELECT IF(utc_timestamp >= DATE_ADD( initial_time, INTERVAL length_in_duration MINUTE)
          AND date(utc_timestamp) < (closing_date)), 1 ,0) FROM table;

我遇到了 MySQL 语法错误,请大家帮忙.

I get MySQL syntax error, any one please help.

推荐答案

closure_date)) 后面多了一个)

我强烈建议您使用 Notepad++ 之类的编辑器,您可以在其中突出显示括号/方括号,它会找到匹配的关闭/打开的.

I highly suggest you using a editor like Notepad++, where you can highlight parentheses/brackets and it will find the matching close/open ones.

这篇关于选择查询中单个 IF 中的多个条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆