0

Ok, well I know I can just say WHERE example='vrvrv' but that's not the case. Ok I have a rating system and whenever a page is rated the page id and the date it was rated is sent to a table in my database. Now on the homepage I want to determine top rated that day, I can easily compare dates but I'm not quite sure how to count how many rows have the same value in the project_id column. It would be amazing if someone could help me out, thanks!

1 Answer 1

2

You can use GROUP and COUNT to get duplicates:

SELECT count(`project_id`) AS `duplicates` FROM `table` GROUP BY `project_id` HAVING `duplicates` > 1
Sign up to request clarification or add additional context in comments.

2 Comments

Wait, what exactly is id your selecting?
I just assumed an ID ... you can skip that

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.