SQL statement Query Update delete

Source: Internet
Author: User

First, query statements

Get the first 10 records of data

Oracle

SELECT * from tab where rownum <= 10;

SQL Server:

Select Top Ten * from tab

Mysql:

SELECT * from tab limit 10

SELECT * FROM table name limit m,n; Starting with M, take N bar

Second, update the statement

UPDATE table name SET column name = new value WHERE Column name = value

Update < table name > set < column name > = < value > WHERE condition

Third, delete the statement

Oracle

1. D ROP To Delete a table:
DROP TABLE table_name;

2,Truncate Delete all the data in the table:
Trancate table table_name;

3. D elete to delete a row that satisfies a condition:
Delete from table_name where your_conditions;
Commit

SQL Server:

1. D ROP

DROP table TB--TB indicates the name of the data table delete the entire table (table data and table structure)

2. T runcate

TRUNCATE TABLE TB deletes the entire sheet data without deleting the table structure

3,Delete

Delete Table TB where condition Delete eligible data in table, delete by row

Mysql:

1. D ROP To Delete a table:
DROP TABLE table_name;

2. T runcate Delete all data from the table:
Trancate table table_name;

3. D elete to delete a row that satisfies a condition:
Delete from table_name where your_conditions;
Commit

SQL statement Query Update delete

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.