Jump to content

Calling SQL experts: count and group by


k2s

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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...