How to reset AUTO_INCREMENT in MySQL and start counting from 1 again?
Let say you have a table called "my_table" with an auto-increment column called "id" and you want the id column to start counting from 1,2,3,... then use the following SQL…
Let say you have a table called "my_table" with an auto-increment column called "id" and you want the id column to start counting from 1,2,3,... then use the following SQL…
Well, first rule – you should not do this. But if there is good reason, consider using such query for searching in index-based arrays: In case you have assoc array…
Assuming your date column is an actual MySQL date column: SELECT * FROM jokes WHERE date > DATE_SUB(NOW(), INTERVAL 1 DAY) ORDER BY score DESC; SELECT * FROM jokes WHERE…