Jump to content

Counting And Grouping


Recommended Posts

I have a table like so:ID | Ref | ip1 | 6 | 110.10.2.12 | 7 | 112.132.0.13 | 6 | 110.10.2.14 | 8 | 119.10.2.15 | 5 | 110.0.2.16 | 7 | 105.10.1.17 | 6 | 101.10.2.0I wish to do an SQL to get the following result:Ref | Total6 | 37 | 25 | 18 | 1counting the total of each distinct ref. and ordering the resultsI think i need to do an inner join but I don't know how

Link to post
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.

Loading...
×
×
  • Create New...