0

I have a table that is structured like so:

Account, Tag
------------
123, dog
123, owl
456, pig
456, goat
678, dog
789, owl

I need to create a statement that will return the following data:

Tag name with the total number of account it's on:

Dog 2
owl 2
pig 1
goat 1

1 Answer 1

3
select Tag, count(*)
from table
group by Tag
Sign up to request clarification or add additional context in comments.

2 Comments

How would I include another column in there as well? I have one more called total clicks so I need to add up all the clicks that each keyword has in total
@SBB add , SUM(clicks) to the select list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.