I have a table: box (id autoincrement, net_amount, created_at timestamp); I need to create a query in php mysql to select the last inserted record every month. Thus to get the net_amount at the end of every month. I am trying this simple query:
select * from box
where box.created_at < 20055332516028
While the max created_at in my table is 2017-10-14 10:42:30, there is no records when I use the given query, I need to increase the number to get the records!!!