Manually escaping commas on SQL statements
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.
精彩评论