MySQL delete all rows where id is greater than the given number

后端 未结 1 1968
予麋鹿
予麋鹿 2020-12-29 07:20

Is there an Sql query I can run that will enable me to delete all rows where the ID is greater than let\'s say 10?

Something like this.

I have two columns, I

1条回答
  •  醉梦人生
    2020-12-29 07:45

    Your query was nearly perfect ;)

    Just try

    DELETE FROM table_name WHERE ID>9;
    

    You could also use

    DELETE FROM table_name WHERE ID>=10;
    

    As you already mention.

    0 讨论(0)
提交回复
热议问题