Hey all-
I'm not the greatest with SQL statements and this is my first endeavor into hibernate and HQL so I'm having some issues. Can somebody help fix this attempt at an HQL query?
Code:
select p1 from Product as p1 left outer join Product p2
with p1.timestamp<p2.timestamp and p1.id=p2.id
where isNull(p2)
The idea is to grab the most recent "version" of a each kind of product in the table. I think an outer join on the timestamp column where p1 are more recent than p2, then finding rows where is no p2 value because there are none more recent than p1. I hope that makes sense. Thanks in advance.