Oracle SQL get one of each data -


if had table column of hello , had multiple rows data 'world' , multiple data dave (there other columns too) , wanted select different types of data within hello column.

so looking return 2 results, 1 being world , other being dave.

another option count how many different data pieces there in column(2 in case) , searching rownum , sorting results (although i'd assume similar search.)

thanks

if don't want duplicates in result - add distinct :

select distinct hello yourtable

and if want count different values :

select hello, count(*) yourtable group hello


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -