i have a table where termid,termversion are two primary key.
column present in table – termid,termversion,name
I want to select all term whose name ilike '%AB%' and the result should contain each matching term with maximum version number.
Example:
id name ver
1 ABBBB 1
1 ABBBB 2
1 ABBBB 3
2 ABC 1
2 ABC 2
output should come
1 ABBBB 3
2 ABC 2
I want to write this query in hibernate using
Criteria…if any one can suggest me in hibernate then its really good else at least help me in writing the sql query.
PS I am using postgresql
I think that is what you are looking for:
is it?