-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to max() on a cast (String as integer)
PostPosted: Tue Sep 15, 2009 5:16 pm 
Newbie

Joined: Tue Sep 15, 2009 5:13 pm
Posts: 1
I want to be able to take the max of a column and add one to it but it returns as a string and has to be cast as an integer. However, this query: SELECT max(cast(stn.id,integer)) FROM Object Stn doesn't work and only gives me an error telling me the query couldn't be executed. What's the correct way of selecting the maximum on a cast?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.