0

i have a mysql table which contains

id,(primary key)

user_id,

**number**,

date

columns.I want a query which select count number for same date and same user_id.

for example,date column have 3 entries of 09/07/2014,then i want a query which return count 3.

my where condition contains only user_id

SELECT number,date FROM play_history WHERE  user_id =49

Thanks

2
  • what is meaning of same date? Commented Jul 9, 2014 at 10:54
  • date column contain same date Commented Jul 9, 2014 at 11:15

1 Answer 1

1

select `date`, count(`number`) as num_count
from play_history 
where user_id = 49
group by `date`
Sign up to request clarification or add additional context in comments.

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.