Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在sql where条件中使用farword斜杠_Mysql_Sql_Where In - Fatal编程技术网

Mysql 在sql where条件中使用farword斜杠

Mysql 在sql where条件中使用farword斜杠,mysql,sql,where-in,Mysql,Sql,Where In,我试图搜索一个以/开头的元素,下面是查询 我已经试过了 Select id,url from myindex where url='[/]%' ; Select id,url from myindex where url='/%'; 但没有起作用。 有什么建议可以解决这个问题吗?您不需要=。你想要像一样的。第二个是MySQL的发展方向: Select id, url from myindex where url like '/%'; 使用mysql通配符操作符。在你的情况下,试试这个 Se

我试图搜索一个以
/
开头的元素,下面是查询

我已经试过了

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

Select id,url from myindex where url='/%';
但没有起作用。

有什么建议可以解决这个问题吗?

您不需要
=
。你想要像一样的
。第二个是MySQL的发展方向:

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

使用mysql通配符操作符。在你的情况下,试试这个

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

@Amol Solanke你可以这么说这和我的问题不完全一样。但是为什么要投反对票呢?@Amol Solanke我已经尽力了。。这就是为什么我把我已经尝试过的东西放在这里。好的,谢谢。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
Select id,url 
from myindex 
where url like '/%';