- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 SQL 查询有什么问题?
它不断在 WHERE building_id=:building_id
处返回以下错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':building_id AND WHERE NOT EXISTS ( SELECT 1 FROM ts_roompref ' at line 5: SELECT COUNT(*) totalCount FROM ts_room WHERE building_id=:building_id AND WHERE NOT EXISTS ( SELECT 1 FROM ts_roompref JOIN ts_request ON ts_roompref.request_id = ts_request.roompref_id AND day_id = 1 AND period_id = 1 WHERE ts_room.id = ts_roompref.room_id)
这是我的代码:
SELECT
COUNT(*) totalCount
FROM
ts_room
WHERE building_id=:building_id AND
WHERE
NOT EXISTS (
SELECT 1
FROM ts_roompref
JOIN ts_request
ON ts_roompref.request_id = ts_request.roompref_id
AND day_id = 1
AND period_id = 1
WHERE
ts_room.id = ts_roompref.room_id)
我这里有一个 SQL 表 - http://sqlfiddle.com/#!2/30297/8
最佳答案
关于mysql - 很难在 SQL 查询中放置 2 个 WHERE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14906024/
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve th
我有一个带有输入字段的表单,使用javascript,当用户输入超过2个字符时,它会在第一个输入字段下方创建相同的输入字段。其代码是: Optie 1: 1 && treated[this.na
这是我的: char userInput; int position; vector userVector(7); vector someVector(7,1); cin >> userInput;
尝试使用 typescript 和 redux 构建一个简单的 react crud 应用程序并遇到以下问题。我有一个具有指定签名的函数,它将一个人对象作为参数,如此处所示。 export defau
哦,我多么希望 TCP 像 UDP 一样基于数据包! [查看评论] 但是,唉,事实并非如此,所以我正在尝试实现我自己的数据包层。这是到目前为止的事件链(忽略写入数据包) 哦,我的数据包结构非常简单:两
我想在我的页面底部放置一个包含不同数量图片的栏,这些图片(如果比页面宽)可以左右滚动。 页面宽度在变化,我希望 Pane 的宽度为 100%。 我试图通过让中间的 div 溢出并使用 jquery.a
我曾尝试在工作时将我的 Rails 应用程序 bundle 到我的 Mac 上。在家里它运行良好,我之前已经设法自己解决了它,但这次无论我尝试什么似乎都无法解决它。 我在运行 bundle/bundl
所以我有一个旧的网络表单站点,并且正在努力使其更易于维护。把它扔掉并重写它不是一种选择。 IoC 显然是它首先得到的东西之一,但这给我留下了服务定位器模式和糟糕的品味,并且想知道它是否可以做得更好。
我是一名优秀的程序员,十分优秀!