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
Post a Comment