views:

75

answers:

1

There is sql statement

select distinct create_date from articles

Is it possibele to write this statement using HQL?

Cheers!

+5  A: 

Yes, it is. HQL supports the DISTINCT keyword.

SELECT DISTINCT a.createDate FROM Article a

I'd propose naming your entity Article (rather than articles) and to use camelCase (rather than under_score)

Bozho
Thanks, thanks, thanks!
glebreutov