I am using JPQL to write queries. I have an SQL as

SELECT * 
FROM  `powergenerationdatapoint` AS pgdp
INNER JOIN (

SELECT MAX( TIMESTAMP ) TIME
FROM powergenerationdatapoint
GROUP BY solarpanel_id
)maxtime ON pgdp.timestamp = maxtime.time
WHERE solarpanel_id
IN (

SELECT id
FROM solarpanel
WHERE solar_plant_id =1
)
GROUP BY solarpanel_id

This is query with Subquery in JOIN. How do I write this in JP QL

and what's this to do with Java

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.