From: Aaron Schulz Date: Fri, 4 May 2007 22:54:13 +0000 (+0000) Subject: *Support for HAVING clause X-Git-Tag: 1.31.0-rc.0~53079 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=ccb7b43392a3cdfd023233dd01a6aec116a2cd4b;p=lhc%2Fweb%2Fwiklou.git *Support for HAVING clause --- diff --git a/includes/Database.php b/includes/Database.php index 3fd6ad169c..21e38ba98d 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1091,6 +1091,7 @@ class Database { } if ( isset( $options['GROUP BY'] ) ) $preLimitTail .= " GROUP BY {$options['GROUP BY']}"; + if ( isset( $options['HAVING'] ) ) $preLimitTail .= " HAVING {$options['HAVING']}"; if ( isset( $options['ORDER BY'] ) ) $preLimitTail .= " ORDER BY {$options['ORDER BY']}"; //if (isset($options['LIMIT'])) { @@ -1175,7 +1176,6 @@ class Database { if (isset($options['EXPLAIN'])) { $sql = 'EXPLAIN ' . $sql; } - return $this->query( $sql, $fname ); } diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 2892d952ac..b946912366 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -1097,6 +1097,7 @@ END; } if ( isset( $options['GROUP BY'] ) ) $preLimitTail .= " GROUP BY " . $options['GROUP BY']; + if ( isset( $options['HAVING'] ) ) $preLimitTail .= " HAVING {$options['HAVING']}"; if ( isset( $options['ORDER BY'] ) ) $preLimitTail .= " ORDER BY " . $options['ORDER BY']; //if (isset($options['LIMIT'])) {