2024-01-15, 06:50
Hi all,
I am an absolute novice with mysql and am having a hard time modifying the below query. I am hoping there might be a SQL ninja on here that can help me out.
I have the below SQL which is 99% working for my needs, this helps me find duplicates in Kodi but there are a large number of false-positives that I want the select statement to ignore.
The problem I am facing - I would like to include something like this in the first select statement so that filenames with '%CD1' will be ignored:
WHERE strfilename NOT LIKE '%CD1%' and strfilename NOT LIKE '%CD2%'
I feel like I am missing something obvious, I keep getting syntax errors.
Appreciate any insights,
TJ
I am an absolute novice with mysql and am having a hard time modifying the below query. I am hoping there might be a SQL ninja on here that can help me out.
I have the below SQL which is 99% working for my needs, this helps me find duplicates in Kodi but there are a large number of false-positives that I want the select statement to ignore.
sql:.header on
.mode csv
.output //MyServer/MyShare/Misc/Scripts/DuplicateMovies/KODI/SQL_DUPES_KODI_EPISODES_RESULTS.csv
select
tvshow.c00 show,
episode.c12 s,
episode.c13 e,
episode.c00 title,
count(*) num,
group_concat(path.strPath || files.strFilename) locations
from files
join episode on episode.idFile = files.idFile
join path on files.idPath = path.idPath
join tvshow on episode.idShow = tvshow.idShow
group by episode.idShow, s, e having num > 1;
The problem I am facing - I would like to include something like this in the first select statement so that filenames with '%CD1' will be ignored:
WHERE strfilename NOT LIKE '%CD1%' and strfilename NOT LIKE '%CD2%'
I feel like I am missing something obvious, I keep getting syntax errors.
Appreciate any insights,
TJ