A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
Joined: Feb 09, 2007
Mar 06, 2007 20:29:00
i am writing in sql my query is "select max(sid) from Student" this is my query.
how i write same query using HQL
Joined: Apr 14, 2004
Mar 07, 2007 02:07:00
Its written pretty much the same as you would in SQL:
select max(object.property) from Object object
However, why do you want the max id? I would normally expect an aggregate function to be used on a numeric property, not the primary key?
I agree. Here's the link:
subject: retrive data
HFSJ page#356 chapter 8---A query
Transfer Excel Sheet information to database
jdbc connection and query execution
Comparable interface problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014