equal
deleted
inserted
replaced
554 # interpret it as a positional index in the selection |
554 # interpret it as a positional index in the selection |
555 groups = ','.join(vref.accept(self) for vref in groups |
555 groups = ','.join(vref.accept(self) for vref in groups |
556 if not isinstance(vref, Constant)) |
556 if not isinstance(vref, Constant)) |
557 if having: |
557 if having: |
558 # filter out constants as for GROUP BY |
558 # filter out constants as for GROUP BY |
559 having = ','.join(vref.accept(self) for vref in having |
559 having = ' AND '.join(term.accept(self) for term in having |
560 if not isinstance(vref, Constant)) |
560 if not isinstance(term, Constant)) |
561 if needwrap: |
561 if needwrap: |
562 sql = '%s FROM (%s) AS T1' % (self._selection_sql(outerselection, distinct, |
562 sql = '%s FROM (%s) AS T1' % (self._selection_sql(outerselection, distinct, |
563 needalias), |
563 needalias), |
564 sql) |
564 sql) |
565 if groups: |
565 if groups: |