[support] Another DBTNG question
Michael Prasuhn
mike at mikeyp.net
Wed Oct 26 16:17:19 UTC 2011
The Group By is very easy with $query->grouBy('uid'); See
http://drupal.org/node/310075#grouping for more on grouping.
The HAVING clause will need an expression though. See
http://drupal.org/node/310075#expressions for more in expressions. It'll
probably look something like:
$query->expression('HAVING SUM(points) > :placeholder', 'field_alias',
array(':placeholder' => $argument));
Ms. Nancy Wichmann wrote:
> Boombatower's conversion doesn't seem to handle HAVING:
> SELECT uid FROM {userpoints} WHERE uid > 0 GROUP BY uid HAVING SUM(points) > %d
>
> I wonder if this even works on a Postgres system, but that's not my issue.
>
> How would this convert to DBTNG? Yes, I know I can still do a db_query (as I am currently doing), but I'd like to convert everything.
>
>
> Nancy
> Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
>
--
__________________
Michael Prasuhn
503.512.0822 office
mike at mikeyp.net
More information about the support
mailing list