简体   繁体   English

MySQL SELECT的字段小于和大于值

[英]MySQL SELECT with fields less and greater than values

I am trying to do a select query on MySQL with phpMyAdmin or PHP with PDO. 我试图用phpMyAdmin或PHP与PDO对MySQL进行选择查询。

SELECT 'uid' FROM 'clusters' WHERE 'lat'<='47.21125' AND 'lat'>='39.21125' AND 'lng'<='32.90243' AND 'lng'>='22.90243'

However, phpMyAdmin says: 但是,phpMyAdmin说:

#1064 - 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 ''clusters' WHERE 'lat'<='47.21125' AND 'lat'>='39.21125' AND 'lng'<='32.90243' A' at line 1

What is wrong with it? 这有什么问题?

'' creates a string literal in MySQL, so your query is selecting the literal "uid" from the literal "clusters," which is invalid. ''在MySQL中创建一个字符串文字,因此您的查询是从文字“群集”中选择文字“uid”,这是无效的。 Use backtics (or nothing) 使用背景(或没有)

SELECT Uid FROM clusters WHERE lat <= 47.21125 AND lat >= 39.21125
AND lng >= 22.90243

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM