Use of MIN/MAX

5 views
Skip to first unread message

Matthew Painter

unread,
Aug 19, 2013, 2:13:01 PM8/19/13
to h2-da...@googlegroups.com
I am trying to do something pretty simple:

UPDATE t SET d=MIN(?,2) where id=?

It fails with "Syntax error in SQL statement". 

Can MIN only be applied to GROUP BY? Is there another operator I am missing?!?

Thanks!

Matt

Noel Grandin

unread,
Aug 19, 2013, 2:47:08 PM8/19/13
to h2-da...@googlegroups.com

Matthew Painter

unread,
Aug 19, 2013, 3:02:17 PM8/19/13
to h2-da...@googlegroups.com
Thank you! :D


On Mon, Aug 19, 2013 at 7:47 PM, Noel Grandin <noelg...@gmail.com> wrote:
Use LEAST
http://h2database.com/html/functions.html#least

--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/ZWlhgBiznDs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages