多个 Between 子句
如何在 MySQL 查询中使用多个“Between”子句?例如,如果我想选择身高在 20 到 25 之间、体重在 50 到 70 之间的学生。
How can I use more than one 'between' clause in a MySQL query? For example if I want to select students having height between 20 and 25 and weight between 50 and 70.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
WHERE height BETWEEN 20 AND 25 AND Weight BETWEEN 50 AND 70
请记住,您的条件将逐一应用于每一行,而不是“一次应用于整个表格”。
WHERE height BETWEEN 20 AND 25 AND weight BETWEEN 50 AND 70
Bear in mind that your condition being applied to each row one-by-one, not to "whole table at once".