"PHP Devs, Can Someone Make Sense of This Weird MySQL Query?"

ALEX006

New member
Joined
May 11, 2006
Messages
4
Reaction score
0
Hey devs, I'm stuck with a weird MySQL query that's giving me a headache. I've got a table called `orders` with columns for `id`, `customer_id`, `order_date`, and `total`. The query that's bugging me is: `SELECT * FROM orders WHERE order_date > DATE_SUB(CURDATE(), INTERVAL 30 DAY) AND order_date IN (SELECT order_date FROM orders GROUP BY order_date HAVING COUNT(*) > 1);` Can anyone explain what it's trying to do?
 

Oliks

New member
Joined
Jan 18, 2017
Messages
4
Reaction score
0
"Lol, sounds like a code nightmare. Can you paste the query in here? Maybe someone can break it down for us and explain what's goin' on"
 
Top