Four simple SQL statements (add, delete, modify, and query statements) and SQL statements

Source: Internet
Author: User

Four simple SQL statements (add, delete, modify, and query statements) and SQL statements
Four simple SQL statements (add, delete, modify, and query statements) I. insert statements

Insert into [table] ([column], [column], [column]) values (?,?,?)
Ii. Delete statements
Delete from [table] where column =?
3. Modify statements
Update [table] set column =? Where column =?
4. query statement 1) query all fields of a single record
Select * from [table] where [column] =?
2) query all fields of all records
Select * from [table]
Order by [column] asc

Note:

1. order by column asc: column fields are arranged in ascending order. Desc is in descending order. 3) query all fields of a record with a given offset.
Select * from [table] limit [offset], [limit]

Note:

1. offset specifies the index from which the query starts. The default value is 0. 2. limit specifies the number of records to be queried. 4) query the specified field of the specified record.
Select [column], [column] form [table] where [column] =?

Related Article

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.