0

Here's a little bit of background. I have a database like this:

    uristem       username
  +------------+  +-------+
  | /uristem/1 |  | user1 |
  | /uristem/2 |  | user2 |
  | /uristem/3 |  | user3 |
  | /uristem/3 |  | user4 |
  | /uristem/1 |  | user1 |
  | /uristem/7 |  | user5 |
  | /uristem/5 |  | user3 |
  | /uristem/5 |  | user1 |
  | /uristem/3 |  | user1 |
  +------------+  +-------+

I need to count the number of (unique) users that hit /uristem/3. What operators can I use in a query to do this?

Your help is greatly appreciated,

Thanks!

1
  • Thank you for the response! I'm not skilled in this area and know very little, so it helps a lot! Commented Nov 8, 2012 at 16:03

3 Answers 3

1
SELECT COUNT(DISTINCT username)
FROM yourTableName
WHERE uristem = '/uristem/3'
Sign up to request clarification or add additional context in comments.

Comments

0

I suppose this is one table with 2 columns.

Select Count(Distinct username)
From Table
Where uristem = '/uristem/3'

Comments

0

The following query will return the number of unique unsers that hit /uristem/3:

SELECT COUNT(DISTINCT `username`) AS nb
FROM `your_table`
WHERE `uristem`='/uristem/3'

Comments

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.