I have a SQLite table with a field named FullFilename. Now, I want to select the rows of files in a certain folder. Let's say the table contains:
c:\folder\file1.jpg
c:\folder\file2.jpg
c:\folder\subfolder\file1.jpg
c:\anotherfolder\file1.jpg
And I want to select only the rows with files in "c:\folder\". Not in a subfolder "c:\folder\subfolder\". This:
SELECT FullFilename FROM Files WHERE fullfilename LIKE "c:\folder\%"
won't work, because it also gives me the files in the subfolder.
How do I extract rows of files in a certain folder without getting files in a subfolders?
Edit
Because the answer is a bit buried in a comment below: Here is the correct answer that Mark provided:
SELECT FullFilename FROM Files
WHERE fullfilename LIKE 'c:\folder\%' AND
fullfilename NOT LIKE 'c:\folder\%\%'
I removed the lower() function as according to the SQLite documentation the LIKE operator is already case insensitive.