mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 04:56:06 +00:00
take out order by in temp. tables
This commit is contained in:
parent
b5ae39836c
commit
752f4e8760
|
@ -555,24 +555,24 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
"SELECT `tblDocumentReceiptLog`.`receiptID` AS `receiptID`, ".
|
||||
"MAX(`tblDocumentReceiptLog`.`receiptLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentReceiptLog` ".
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
break;
|
||||
case 'pgsql':
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttreceiptid` (`receiptID` INTEGER, `maxLogID` INTEGER, PRIMARY KEY (`receiptID`);".
|
||||
"INSERT INTO `ttreceiptid` SELECT `tblDocumentReceiptLog`.`receiptID`, ".
|
||||
"MAX(`tblDocumentReceiptLog`.`receiptLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentReceiptLog` ".
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
break;
|
||||
default:
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttreceiptid` (PRIMARY KEY (`receiptID`), INDEX (`maxLogID`)) ".
|
||||
"SELECT `tblDocumentReceiptLog`.`receiptID`, ".
|
||||
"MAX(`tblDocumentReceiptLog`.`receiptLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentReceiptLog` ".
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentReceiptLog`.`receiptID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
}
|
||||
if (!$this->_ttreceiptid) {
|
||||
if (!$this->getResult($queryStr))
|
||||
|
@ -596,24 +596,24 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
"SELECT `tblDocumentRevisionLog`.`revisionID` AS `revisionID`, ".
|
||||
"MAX(`tblDocumentRevisionLog`.`revisionLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentRevisionLog` ".
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
break;
|
||||
case 'pgsql':
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttrevisionid` (`revisionID` INTEGER, `maxLogID` INTEGER, PRIMARY KEY (`revisionID`));".
|
||||
"INSERT INTO `ttrevisionid` SELECT `tblDocumentRevisionLog`.`revisionID`, ".
|
||||
"MAX(`tblDocumentRevisionLog`.`revisionLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentRevisionLog` ".
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
break;
|
||||
default:
|
||||
$queryStr = "CREATE TEMPORARY TABLE IF NOT EXISTS `ttrevisionid` (PRIMARY KEY (`revisionID`), INDEX (`maxLogID`)) ".
|
||||
"SELECT `tblDocumentRevisionLog`.`revisionID`, ".
|
||||
"MAX(`tblDocumentRevisionLog`.`revisionLogID`) AS `maxLogID` ".
|
||||
"FROM `tblDocumentRevisionLog` ".
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ".
|
||||
"ORDER BY `maxLogID`";
|
||||
"GROUP BY `tblDocumentRevisionLog`.`revisionID` ";
|
||||
// "ORDER BY `maxLogID`";
|
||||
}
|
||||
if (!$this->_ttrevisionid) {
|
||||
if (!$this->getResult($queryStr))
|
||||
|
|
Loading…
Reference in New Issue
Block a user