The following queries a set of columns (Folders) and counts the number of columns (files) associated with each.
SELECT FOLDERS.Folder_Name,FOLDERS.Folder_Parent,FOLDERS.Folder_Id,
Count(FILES.Folder_Id) AS File_Count,
SUM(FILES.File_Size) as SUM
FROM FOLDERS
LEFT JOIN FILES ON FILES.Folder_Id = FOLDERS.Folder_Id
WHERE FOLDERS.Project_Id = '3' AND FOLDERS.Is_Deleted = '0'
GROUP BY FOLDERS.Folder_Id
and returns a result
Name Parent Id Count SUM
HTML 0 12 0 0
Documents 0 13 0 0
Graphics 0 14 10 168827
Media 0 15 5 192531
Audio 15 16 0 0
Video 15 17 0 0
Trouble is:
It continues to count all the files not excluding those marked is_deleted '1'
skipping the where clause all toghther. no errors. it just ignores the condition.
Any thoughts?
Is this a bug?
~ Patrick
SELECT FOLDERS.Folder_Name,FOLDERS.Folder_Parent,FOLDERS.Folder_Id,
Count(FILES.Folder_Id) AS File_Count,
SUM(FILES.File_Size) as SUM
FROM FOLDERS
LEFT JOIN FILES ON FILES.Folder_Id = FOLDERS.Folder_Id
WHERE FOLDERS.Project_Id = '3' AND FOLDERS.Is_Deleted = '0'
GROUP BY FOLDERS.Folder_Id
and returns a result
Name Parent Id Count SUM
HTML 0 12 0 0
Documents 0 13 0 0
Graphics 0 14 10 168827
Media 0 15 5 192531
Audio 15 16 0 0
Video 15 17 0 0
Trouble is:
It continues to count all the files not excluding those marked is_deleted '1'
skipping the where clause all toghther. no errors. it just ignores the condition.
Any thoughts?
Is this a bug?
~ Patrick