开发者

Manually escaping commas on SQL statements

开发者 https://www.devze.com 2023-04-01 17:25 出处:网络
I have a yuzeyKo (varchar) table whi开发者_StackOverflow中文版ch containing some coordinates like this : 23,45 (longitude,latitude)

I have a yuzeyKo (varchar) table whi开发者_StackOverflow中文版ch containing some coordinates like this : 23,45 (longitude,latitude)

For example i will execute an SQL like this :

SELECT COUNT(*) FROM tablename WHERE yuzeyKo = 29,59;

But (ofcourse) this isn't working. There is a syntax error because i have to escape comma on WHERE yuzeyKo = 29,59;

But there isn't any special escape character for commas. What should i do?

I'm using MySQL .


Is yuseyKo column a VARCAHR column? if so should your SQL query be:

SELECT COUNT(*) FROM tablename WHERE yuzeyKo = '29,59';


you probably need something like this:

SELECT COUNT(*) FROM tablename WHERE yuzeyKo = '29,59';

this is assuming your yuzeyKo field is some kind of character type.

0

精彩评论

暂无评论...
验证码 换一张
取 消