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)