glebreutov
glebreutov

Reputation: 785

Is it possibele to write this SQL statement using HQL?

There is sql statement

select distinct create_date from articles

Is it possibele to write this statement using HQL?

Cheers!

Upvotes: 1

Views: 195

Answers (1)

Bozho
Bozho

Reputation: 597324

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)

Upvotes: 5

Related Questions