All data in the PHP MySQL delete table is kept only one

Source: Internet
Author: User
DELETE from ' logs ' WHERE wangzhi= ' www.juhutang.com ' and  id<>101072;

The above code means to delete all the fields in the table logs Wangzhi contains data with www.juhutang.com content. However, this data with ID 101072 in the same table is not deleted.

Of course, I am a novice, this statement may not be so perfect as the title,

I hope Daniel will answer, delete all the data in the table, keep the most recent one or only the one with the largest primary key ID. How this statement is written.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.