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.

here sqlfiddel demo

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

here sqlfiddel demo


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

here sqlfiddel demo


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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -