Your statement is so full of errors that it is incomprehensible to me.
|
SELECT SUM (ALMOX.VALORUNT)FROM WAREHOUSE WHERE ALMOX ALMOX.COD_ITEM
=23ORDER BY DESC LIMIT 3ALMOX.DTENTRADA
|
Did you mean something like:
SELECT SUM(ALMOX.VALORUNT)
FROM WAREHOUSE AS ALMOX
WHERE ALMOX.COD_ITEM = 23
|ORDER BY |||ALMOX.DTENTRADA |DESC
|LIMIT 3
(This assumes the implicit GROUP BY() that Lukas Eder was telling about
a while back).
I wonder, how far do these other databases go when it comes to accepting
incorrect syntax?
- Rami
On 6.11.2015 15:51, Rogerio Queiroz wrote:
*JdbcURL: jdbc:h2:~/INVENTARIO1;AUTO_SERVER=TRUE;IFEXISTS=TRUE;WRITE_DELAY=0*
*user: sa, pass: dataview*
*
*
OK!
It is generating error when using the order by the following query:
|
SELECT SUM (ALMOX.VALORUNT)FROM WAREHOUSE WHERE ALMOX ALMOX.COD_ITEM
=23ORDER BY DESC LIMIT 3ALMOX.DTENTRADA
|
I say I have to do a grouping *ALMOX.DTENTRADA*
, so if I withdraw the order, the select normally performs.
I tested on a database in MySQL, Firebird and hsqldb and this error
does not happen because of the sorting by ALMOX.DTENTRADA.
H2database version is _1.4.190_
This is a bug?
/Grateful for the attention. I hope this helps./
--
You received this message because you are subscribed to the Google
Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.