Your Friend Your Friend - 5 days ago 7
MySQL Question

using farword slash in sql where condition

Iam trying to search an element which starts with

/
below is the query i already tried...

Select id,url from myindex where url='[/]%' ;

Select id,url from myindex where url='/%';


but not worked.. any suggestion to fix this?

Answer

You don't want =. You want like. The second is the way to go in MySQL:

Select id, url
from myindex
where url like '/%';
Comments