Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/77.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
带LIKE的SQLite正则表达式_Sql_Regex_Sqlite - Fatal编程技术网

带LIKE的SQLite正则表达式

带LIKE的SQLite正则表达式,sql,regex,sqlite,Sql,Regex,Sqlite,您好,我有一张下一行的桌子: Path ------------------- Archive.zip MyFile.zip MyFolder MyFolder/myfiledata.txt MyFolder/otherfile.dat OtherFolder OtherFolder/otherfile.dat OtherFo

您好,我有一张下一行的桌子:

Path    
-------------------                   
Archive.zip                
MyFile.zip                 
MyFolder                   
MyFolder/myfiledata.txt    
MyFolder/otherfile.dat     
OtherFolder
OtherFolder/otherfile.dat  
OtherFolder/More/filenext.dat  
OtherFolder/Less/filenext.dat  
我只想使用第一级:

Path
-------------------                       
Archive.zip                
MyFile.zip                 
MyFolder                   
OtherFolder                    
使用SQLite的查询将是什么


谢谢

您可能需要这样的东西:

SELECT Path FROM PathTable WHERE Path NOT LIKE '%/%'

有时,最容易想到的是,你可以做些什么来选择相反的结果

SELECT Path from YourTable WHERE NOT (Path LIKE '%/%')
要学究化--
一样,不使用或支持正则表达式语法;如果您真的需要正则表达式,sqlite有一个单独的
REGEX
操作符,而您实际上不需要正则表达式<类似于的code>实际上(几乎)是一个不区分大小写的
GLOB
版本,它使用
%
而不是传统的UNIX
*