Basic knowledge of SQL Server Learning (1)

Source: Internet
Author: User
1.DISTINCT DISTINCT This keyword is used to filter out redundant duplicate records to keep only one, but it is often used only to return the number of distinct records, rather than using it to return all values that are not re-recorded. The reason is that distinct only with double-loop query to solve, and so for a very large number of stations, will undoubtedly directly affect the efficiency.   The 2.ORDER by order BY statement is used to sort the result set based on the specified column. The order BY statement sorts records by default in ascending order (ascending). Descending (Descending) Select (column 1, column 2, ...) From table name order BY column 1, column 2 Asc/desc one-by -one 3. copy table Select*into new table from old table (new table does not copy primary key of old table) 4. Insert table 2 data into table 1 inserts into table 1 (      Column 1, column 2) Select (column 1, column 2) from table 25. Constraint entity integrity constraint PRIMARY KEY constraint (Primary key) domain integrity constraint foreign KEY constraint (Foreign key references table name (same field name)) Check constraint (check (plus condition))

Basic knowledge of SQL Server Learning (1)

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.