Sql-and & OR & Order by & INSERT into

Source: Internet
Author: User

The and & OR operators are used to filter records based on more than one condition.

The order by statement is used to sort the result set.

The order BY statement sorts records by default in ascending order. You can use the DESC keyword if you want to use descending order.

INSERT INTO inserts a new row into the table.

Grammar:

INSERT into Talbe_name VALUES (value1,value2,...)

You can also make a column that asks for data to be inserted:

INSERT into Table_anme (Column1,column2,...) VALUES (value1, value2,..)

Example:

Insert a new row

"Persons" table

City
LastName FirstName Address
Carter Thomas Changan Street Beijing

SQL statements:

INSERT into Persons VALUES (' Gates ', ' Bill ', ' xuanwumen ', ' Beijing ')

Results

City
LastName FirstName Address
Carter Thomas Changan Street Beijing
Gates Bill Xuanwumen 10 Beijing

Insert data in the columns you have made:

INSERT into Persons (LastName, Address) VALUES (' Wilson ', ' champs-elysees ')

Results

City
LastName FirstName Address
Carter Thomas Changan Street Beijing
Gates Bill Xuanwumen 10 Beijing
Wilson Champs-elysees

Sql-and & OR & Order by & INSERT into

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.