I have array of strings. For example 10 strings in array FileNamesArray[]
I have a DB table that contain 7 rows. MyFiles table description:
ID int
FileName varchar
I want to know which of strings from array doesn’t exist in my table.
Smth like this:
"SELECT * FROM (" + FileNamesArray + ") LEFTJOIN MyFiles ON FileNamesArray = MyFiles.FileName WHERE MyFiles.FileName IS NULL
How to express it in SQL?
Can I avoid temp tables?
P.S. Example
FileNamesArray = ['file1', 'file2', 'file3', ..., 'file10']
MyFiles = ['file0', 'file1', ..., 'file6']
I need to get answer = ['file7', 'file8', 'file9', 'file10']
If you filenames are fixed you could declare an memory table, so for example
I can’t see how you could get away from using a temp table, hope this helps