k2s Posted February 4, 2017 Report Posted February 4, 2017 Oka table lo name , site, channel, posts scrooge, afdb, discussion, 100 scrooge,afdb, visa, 10 scrooge, ttdb, discussion, 100 spartan, afdb, discussion. 200 spartan, afdb, masala, 3000 spartan, ILDB, relationship, 10000 samaja, afdb, masala, 100 loser, afdb, masala, 10000 loser, afdb, discussion, 100 undi... i want output as in how many distinct channels scrooge participated(afdb and ttdb) name , site scrooge, 2 spartan, 2 samaja, 1 loser, 1 emi cheyyali Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 Calling @loveindia, @jbourne, @Spartan, @kiladi bullodu Quote
Prince_Fan Posted February 4, 2017 Report Posted February 4, 2017 no.of distinct channels aithe idi anukulu ... select name, count(distinct channel) from table group by name Quote
Prince_Fan Posted February 4, 2017 Report Posted February 4, 2017 no.of distinct sites for each person aithe idi... select name, count(distinct site) from table group by name Quote
Bhai Posted February 4, 2017 Report Posted February 4, 2017 38 minutes ago, k2s said: Oka table lo name , site, channel, posts scrooge, afdb, discussion, 100 scrooge,afdb, visa, 10 scrooge, ttdb, discussion, 100 spartan, afdb, discussion. 200 spartan, afdb, masala, 3000 spartan, ILDB, relationship, 10000 samaja, afdb, masala, 100 loser, afdb, masala, 10000 loser, afdb, discussion, 100 undi... i want output as in how many distinct channels scrooge participated(afdb and ttdb) name , site scrooge, 2 spartan, 2 samaja, 1 loser, 1 emi cheyyali thatha nee explanation wrong. afdb,ttdb are not channels they are sites. Ika Answer antava paina @Prince_Fan vuncle ichadu choodu... valla Christian roommate confirm chesadu (vuncle eeroje talantu posadanta) Quote
Spartan Posted February 4, 2017 Report Posted February 4, 2017 @k2s Select name, count(Distinct site) as "number of sites" from <tablename> Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 37 minutes ago, Prince_Fan said: no.of distinct channels aithe idi anukulu ... select name, count(distinct channel) from table group by name thanks lolbob... adey chesa... naaku number of distinct channels for distinct names kavali.... so i used select distinct name, count(distinct channel) ani use chesa.. Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 13 minutes ago, Bhai said: thatha nee explanation wrong. afdb,ttdb are not channels they are sites. Ika Answer antava paina @Prince_Fan vuncle ichadu choodu... valla Christian roommate confirm chesadu (vuncle eeroje talantu posadanta) lolbob ki ardam ayindi.. answer seppadu. madyalo nuvvu thappulu vethaku..... naaku query execute ayindi with result 20 mins back ee Quote
mysterious Posted February 4, 2017 Report Posted February 4, 2017 select name, count(distinct(channels)) from tablename where name='scoorge'; Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 7 minutes ago, Spartan said: @k2s Select name, count(Distinct site) as "number of sites" from <tablename> select distinct name, count(distinct site) name kuda distinct kavali uncle.. Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 Just now, mysterious said: select name, count(distinct(site)) from tablename where name='scoorge'; gappudu scrooge okka row ki answer osthadi... emo Quote
mysterious Posted February 4, 2017 Report Posted February 4, 2017 the above ans is according to your question and if you are looking for total count for scoorge Quote
k2s Posted February 4, 2017 Author Report Posted February 4, 2017 2 minutes ago, mysterious said: the above ans is according to your question and if you are looking for total count for scoorge i want for all users man.. like this name , site scrooge, 2 spartan, 2 samaja, 1 loser, 1 Quote
mysterious Posted February 4, 2017 Report Posted February 4, 2017 select name, count(distinct site) from tablename group by site; Quote
mysterious Posted February 4, 2017 Report Posted February 4, 2017 select name, site, count( *) from k2s group by name, site; samaja afdb 1 loser afdb 2 scrooge ttdb 1 spartan afdb 2 scrooge afdb 2 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.