sql - Count single occurrences of a row item -
i count number of times item in column has appeared once. example if in table had...
name ---------- fred barney wilma fred betty barney fred
...it return me count of 2 because wilma , betty have appeared once.
below query can try:
select count(*) (select name table1 group name having count(*) = 1) t
till above post actual post.
below post modified question:
in oracle can try below query:
select sum(count(rownum)) table1 group "name" having count(*) = 1
or
in sql server can try below query:
select count(*) table1 left join table1 b on a.name=b.name , a.%%physloc%% <> b.%%physloc%% b.name null
or
in sybase can try below query:
select count(count(name)) table group name having count(name) = 1
as per @user2617962's answer.
thank you
Comments
Post a Comment