[英]Get records between two point values in Mysql
我有两列存储值(点值)。
如何选择给定数字在两列值之间的位置?
我希望你能通过这样做得到它:
让你的号码是 $your_number 表名是 your_table
所以你的查询是:
SELECT * FROM your_table WHERE $your_number BETWEEN col1 AND col2;
或者如果确保 col1 < col2
SELECT * FROM your_table WHERE $your_number >= col1 AND $your_number <= col2;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.