PHP SQL Query: how to select same Ids?
My code is:
$vote = DB::SELECT(DB::RAW("SELECT * FROM votes WHERE product_id = product_id; "));
Here is a screenshot of my DB.
I'd like to ask how to select the same Producut Id in the SQL Query?
If you want to count sum of votes for each product and sort sum of votes from highest to lowest, then your query is: