" Job.JobBytes AS Bytes,"
" Job.JobId AS JobId"
" FROM Job"
- " LEFT OUTER JOIN Client ON (Client.ClientId=Job.ClientId)"
- " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId)"
- " LEFT OUTER JOIN Status ON (Job.JobStatus=Status.JobStatus)"
- " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId)"
- " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId)";
+ " JOIN Client ON (Client.ClientId=Job.ClientId)"
+ " JOIN Status ON (Job.JobStatus=Status.JobStatus)"
+ " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId)";
+
QStringList conditions;
int jobIndex = controls->jobComboBox->currentIndex();
if ((jobIndex != -1) && (controls->jobComboBox->itemText(jobIndex) != "Any"))
if ((clientIndex != -1) && (controls->clientComboBox->itemText(clientIndex) != "Any"))
conditions.append("Client.Name='" + controls->clientComboBox->itemText(clientIndex) + "'");
int volumeIndex = controls->volumeComboBox->currentIndex();
- if ((volumeIndex != -1) && (controls->volumeComboBox->itemText(volumeIndex) != "Any"))
+ if ((volumeIndex != -1) && (controls->volumeComboBox->itemText(volumeIndex) != "Any")) {
+ query += " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId)"
+ " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId)";
conditions.append("Media.VolumeName='" + controls->volumeComboBox->itemText(volumeIndex) + "'");
+ }
int fileSetIndex = controls->fileSetComboBox->currentIndex();
if ((fileSetIndex != -1) && (controls->fileSetComboBox->itemText(fileSetIndex) != "Any"))
conditions.append("FileSet.FileSet='" + controls->fileSetComboBox->itemText(fileSetIndex) + "'");
int volumeIndex = volumeComboBox->currentIndex();
if (volumeIndex != -1)
m_mediaName = volumeComboBox->itemText(volumeIndex);
- query += "SELECT DISTINCT Job.Jobid AS Id, Job.Name AS JobName, Client.Name AS Client,"
+ query += "SELECT Job.Jobid AS Id, Job.Name AS JobName, "
+ " Client.Name AS Client,"
" Job.Starttime AS JobStart, Job.Type AS JobType,"
" Job.Level AS BackupLevel, Job.Jobfiles AS FileCount,"
" Job.JobBytes AS Bytes,"
" Job.JobStatus AS Status, Status.JobStatusLong AS StatusLong,"
" Job.PurgedFiles AS Purged, FileSet.FileSet"
" FROM Job"
- " LEFT OUTER JOIN Client ON (Client.ClientId=Job.ClientId)"
- " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId)"
- " LEFT OUTER JOIN Status ON (Job.JobStatus=Status.JobStatus)"
- " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId)"
- " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId)";
+ " JOIN Client ON (Client.ClientId=Job.ClientId)"
+ " JOIN Status ON (Job.JobStatus=Status.JobStatus)"
+ " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId) ";
QStringList conditions;
if (m_mediaName != "Any") {
+ query += " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId) "
+ " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId) ";
conditions.append("Media.VolumeName='" + m_mediaName + "'");
}
int clientIndex = clientComboBox->currentIndex();
i += 1;
}
query += " FROM Media"
- " LEFT OUTER JOIN Pool ON (Media.PoolId=Pool.PoolId)"
+ " JOIN Pool ON (Media.PoolId=Pool.PoolId)"
" LEFT OUTER JOIN Pool AS Pol ON (Media.recyclepoolid=Pol.PoolId)"
- " WHERE Media.MediaId='" + mediaId + "'"
- " ORDER BY Pool.Name";
+ " WHERE Media.MediaId='" + mediaId + "'";
if (mainWin->m_sqlDebug) {
Pmsg1(000, "MediaList query cmd : %s\n",query.toUtf8().data());
" Media.Enabled AS enabled, Pol.Name AS RecyclePool,"
" Media.LastWritten AS LastWritten"
" FROM Media"
- " LEFT OUTER JOIN Pool ON (Media.PoolId=Pool.PoolId)"
+ " JOIN Pool ON (Media.PoolId=Pool.PoolId)"
" LEFT OUTER JOIN Pool AS Pol ON (Media.RecyclePoolId=Pol.PoolId)"
" WHERE";
query += " Pool.Name='" + pool_listItem + "'";