when I'm use mysql this is works but with h2 dont. Ok, now I understand why.

thanks.


2011/11/12 Noel Grandin <[email protected]>

> your query doesn't make sense.
> (1) you are using a "group by" and a where clause that only includes
> one group, so the "group by" does nothing
> (2) you can't mix "select *" and "group by"
>
> On Sat, Nov 12, 2011 at 01:04, the nigga <[email protected]>
> wrote:
> > Hello
> >
> > I am trying use the SUM in a SELECT, but that return error.
> >
> > I'm trying this.
> >
> > SELECT *, SUM(number1) AS n1, SUM(number2) AS n2 FROM tabela
> > INNER JOIN tabela2 ON (tabela1.code = tabela2.code)
> > WHERE tabela1.code = 0001
> > GROUP BY tabela1.code
> >
> > any idea ???
> >
> > thanks.
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "H2 Database" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected].
> > For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to