I have the following class structure FlowerDAO with the fields (mapped using Hibernate):
- id
- unitPrice
- name
color
How can i create an hql query to obtain the flower(s) for each color that has(ve) the minimum unit price on that color?
I have tried this, but it doesn't work
from FlowerDAO as f where f.unitPrice<= (select min(f2.unitPrice) from FlowerDAO as f2 where f2.color=f.color)
group by f.color