MySQL Forums
Forum List  »  MySQL Query Browser

Select latest record group by a coloumn
Posted by: Gunjan Nigam
Date: April 06, 2011 11:36PM

I have a following table
Field Type Null Default
id bigint(20) No
current double Yes NULL
timestamp datetime Yes NULL
voltage double Yes NULL
solarpanel_id bigint(20) Yes NULL

I want to get the latest record added for each solarpanl_id. Help me to write the query for this WITHOUT using Joins. I have to convert this query to JP QL later and I can't convert them to JPQL if Join has Subquery in it

Options: ReplyQuote


Subject
Written By
Posted
Select latest record group by a coloumn
April 06, 2011 11:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.