选择并删除mysql中特定行到表末尾的行

I have a mysql table where columns are:

id, date, sold, rev

I like to get row where date column = some date, and I'd like to delete all rows from that row till end of the table. The pseudo-code that comes to my mind goes something like this:

$date = specific date;

$conn->prepare (select id from table where date = $date)
while (id is not last)
{
  $conn->delete (current id from table);
}

In my opinion, I will use

"DELETE FROM table_name WHERE date != $date"

Or is you want to delete from that date to the end of the table provided the date is in an arranged order like descending or ascending you can use

"DELETE FROM table_name WHERE date >= $date"

or

"DELETE FROM table_name WHERE date <= $date"

Id's in mysql are inserted in form of incremental order. So you can select your required id by:

select id from table where date = $date;

once you get the id (assume in variable $id) then execute the query:

delete from table_name where id >= $id;

it will delete all the rows till the end of the table from your required row. it can also be deleted by providing date conidtion (only if you are sure that dates are inserted in incremental order):

delete from table_name where date >= $date;