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.  [ 2 posts ] 
Author Message
 Post subject: how to implement one-to-many Max value
PostPosted: Tue Mar 08, 2005 10:04 am 
Newbie

Joined: Wed Feb 23, 2005 10:36 pm
Posts: 7
Location: Taipei
Hello

Using an auction example, how do you implement this in one query.

For example you have items table and bid table. Now an item can have more than one bid. Suppose I would like only to get the value of the highest bid imported to Items class so can do something like this in my DAO object:

...
Object[] obj = (Object[])iter.next()
Items item = (Items)obj[0];
Bid bid = item.getBid();

How do you implement Max???

Thanks

_________________
The button for mass destruction


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 08, 2005 11:33 am 
Newbie

Joined: Wed Feb 23, 2005 10:36 pm
Posts: 7
Location: Taipei
oh by the way i am using MYSQL.

I have tried using max(bidAmount) as in SELECT max(bid) from BID in SQL but did not work.

_________________
The button for mass destruction


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

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.