======select data Query ======
To query all the data in a table:
SELECT * FROM table name
Select Column Name 1, column name 2, column name 3 ... Column name n from table name
To alias a queried column:
Mode 1, original column name as ' Alias '
Mode 2, the original column name ' Alias '
Mode 3, alias = original column name
Get current system time:
Select Current system time =getdate ()
Calculation:
Select
======top data Query ======
Sort:order BY column name Desc (descending)/asc (ascending) default to Ascending
For the first few data, top is typically used with order by:
Select top value the data to be queried from table name order by column to sort Asc/desc
======distinct data Query ======
Data deduplication for the entire result set that has been queried:
SELECT DISTINCT * FROM table name
Chapter 3. Data retrieval (query)---Select, top, DISTINCT