I have written a SQL query which would fetch duplicates of name and size:
SELECT t1.Filepath,
t1.splitFilePath1(Filepath)
FROM Filemanager t1
INNER JOIN (SELECT splitFilePath1(Filepath),
Size
FROM Filemanager
GROUP BY splitFilePath1(Filepath),
Size
HAVING COUNT(*) > 1) t2
ON t1.Size = t2.Size AND
t1.splitFilePath1(Filepath) = t2.splitFilePath1(Filepath)
In the above query,splitFilePath1(Filepath) is a user defined function which takes Filepath as the input and returns filename.After receiving filename,I have to find duplicates of filename and size.
Error received: Near'(' :Syntax error
I am unable to understand where exactly it expects the '('.
Edit:Solved!! Query: SELECT Filepath,splitFilePath1(Filepath) FROM Filemanager t1 INNER JOIN (SELECT Filepath as Filepath1,splitFilePath1(Filepath),Size FROM Filemanager GROUP BY splitFilePath1(Filepath), Size HAVING COUNT(*) > 1) t2 ON t1.Size = t2.Size AND splitFilePath1(t1.Filepath) = splitFilePath1(t2.Filepath1)
Thanks to lollato!!