What is the keyword of the query command in sql
This article mainly introduces what is the keyword of the query command in sql. It is very detailed and has certain reference value. Friends who are interested must read it!
The simplest query:
Select * from [where ] select column1,column2....from [where]
What needs to be noticed here are the keywords used in conditional filtering in the where clause, such as'%'(matching one or more characters) and'_'(matching only one) in the logical operator like.
Distinct keyword
This keyword is mainly used to extract the unique value in the column.
Use aliases
Aliases can be used to display the name we want, which is easy to read. For example: select city as City from
Group by and having clauses
Group by is used to group the result set of a query and must be placed after the from clause or the where clause in the select statement.
The having clause is similar to the where clause, immediately following the group by clause as a query condition.
Note: the where clause acts on the query conditions in a record, while the having clause acts on the query conditions in a column
Inner join
Multiple tables that require a query must have the same match.
The query result to be executed must be a record with the same class number in both tables before it can be queried.
Left join
Left outer join: when joining, all items in the left table of the on condition are queried, while if there are no matching items in the right table, null is used instead.
Right join
The result of the right outer join is opposite to that of left join, which queries out all the items in the right table, while the left table with no matching items is replaced by null.
Full join
All items, whether left or right, return results. No counterpart is replaced by null.
The above is all the contents of the query command keyword in sql. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!