"FROM ( "
"SELECT JobTDate, PathId, FilenameId " /* Get all normal files */
"FROM File JOIN Job USING (JobId) " /* from selected backup */
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"UNION ALL "
"SELECT JobTDate, PathId, FilenameId " /* Get all files from */
"FROM BaseFiles " /* BaseJob */
"FROM ( "
"SELECT JobTDate, PathId, FilenameId "
"FROM File JOIN Job USING (JobId) "
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"UNION ALL "
"SELECT JobTDate, PathId, FilenameId "
"FROM BaseFiles "
"FROM ( "
"SELECT JobTDate, PathId, FilenameId "
"FROM File JOIN Job USING (JobId) "
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"UNION ALL "
"SELECT JobTDate, PathId, FilenameId "
"FROM BaseFiles "
"FROM ( " /* Choose the last version for each Path/Filename */
"SELECT max(JobTDate) AS JobTDate, PathId, FilenameId "
"FROM File JOIN Job USING (JobId) "
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"GROUP BY PathId, FilenameId "
") AS t1, Job AS j1, File AS f1 "
"WHERE t1.JobTDate = j1.JobTDate "
"FROM ( "
"SELECT max(JobTDate) AS JobTDate, PathId, FilenameId "
"FROM File JOIN Job USING (JobId) "
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"GROUP BY PathId, FilenameId "
") AS t1, Job AS j1, File AS f1 "
"WHERE t1.JobTDate = j1.JobTDate "
"FROM ( "
"SELECT max(JobTDate) AS JobTDate, PathId, FilenameId "
"FROM File JOIN Job USING (JobId) "
- "WHERE JobId IN (%s) "
+ "WHERE File.JobId IN (%s) "
"GROUP BY PathId, FilenameId "
") AS t1, Job AS j1, File AS f1 "
"WHERE t1.JobTDate = j1.JobTDate "