select columnName
from tableName;
columnName
=========
A
A
A
B
B
you would get that columns data from all rows. If you would like to avoid / skip duplicates (and only get the distinct values) you could type:
select distinct columnName
from tableName;
columnName
=========
A
B
Another approach is:
select columnName, count(*)
from tableName
group by columnName;
columnName count(*)
========= ========
A 3
B 2
No comments:
Post a Comment