java - SQL - Fetch any rows based on a distinct property, no duplicates -


is possible run query, says fetch table have distinct property , select matched row distinct property, doesn't matter unique/distinct rows based on 1 property.

if

row1 : name:a, age:10, street:james street row2 : name:b, age:15, street:peter street row3 : name:c, age:17, street:james street 

now query return

row2 , either row1 or row2  

doesn't matter if row1 or row2, don't care.

now, ideally i'd perform using hibernate criteria queries because have query builder , adding option.

it appears if

select distinct on (street) * tbl 

works.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -