Jump to content

Calling SQL experts: count and group by


Recommended Posts

Posted

select name,  count(distinct site) from k2s group by name
loser    1
spartan    2
samaja    1
scrooge    2

Posted
6 hours ago, k2s said:

i want for all users man.. like this

name , site

scrooge, 2

spartan, 2

samaja, 1

loser, 1

 

Image result for brahmi gifs

Chinnu cheppindhi correct vuncle.. group by cheyi..

Select name, count(distinct channel) from table group by name

Posted
3 minutes ago, mettastar said:

Chinnu cheppindhi correct vuncle.. group by cheyi..

Select name, count(distinct channel) from table group by name

Yeah adey sesa baa.. got it

Posted

select count(posts), name, channel, site

group by name, channel, site

 

output will be 

posts         name      channel     site

15000      scrooge     discussion   afdb

5000      scrooge     visa   afdb

Posted
8 hours ago, k2s said:

select distinct name, count(distinct site) 

name kuda distinct kavali uncle.. 

 

Group by return DISTINCT values of group by fields. So no need of DISTINCT after SELECT keyword

Posted

ses

'Select name, count(distinct site) group by name' cheste raada ?

Posted
4 hours ago, former said:

Group by return DISTINCT values of group by fields. So no need of DISTINCT after SELECT keyword

 

3 hours ago, dasara_bullodu said:

ses

'Select name, count(distinct site) group by name' cheste raada ?

Emo man nenu try cheyaledu

Posted
13 hours ago, k2s said:

lolbob ki ardam ayindi.. answer seppadu. madyalo nuvvu thappulu vethaku..... naaku query execute ayindi with result 20 mins back ee 

 

11 hours ago, ARYA said:

landasura thread

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...