1. Basic SELECT Statement
1. Basic SELECT Statement
Select identifies which columns are selected.
From identifies the table from which to select.
Attention:
SQL language is not case sensitive.
SQL can be written in one line or multiple lines
Keywords cannot be abbreviated or branch
The clauses are usually written in branches.
Use indentation to improve the readability of the statement.
2. Arithmetic operators (+-*/)
The arithmetic operator used for numbers and dates.
Operator Precedence:
Multiplication priority is higher than plus and minus.
The same precedence operator executes from left to right.
The operations in parentheses are performed first.
3. Define NULL values
Null value is not valid, unspecified, unknown, or unpredictable value
Null value is not a space or 0.
Use of null values in mathematical operations: null values for mathematical expressions that contain null values
4. Aliases for columns:
Renames a column.
Easy to calculate.
Immediately following the column name, you can also add the keyword ' as ' between the column name and the alias, using double quotation marks to include spaces or special characters in the alias and case sensitivity.
5. Connector:
Concatenate columns and columns with characters.
Use ' | | ' Said.
can be used to ' synthesize ' columns.
6. String:
The string can be a character, a number, a date in the SELECT list.
Dates and characters can only appear in single quotation marks.
Each time a row is returned, the string is output once.
7. Delete duplicate rows: Using the DISTINCT keyword
8.SQL Statements and Sql*plus commands
Sql
A language
ANSI Standard
Keywords cannot be abbreviated
Use statements to control the definition information of tables in a database and the data in a table
Sql*plus
An environment
One of the features of Oracle
Keywords can be abbreviated
Command cannot change the value of data in a database
Centralized operation
8. Show Table structure: Use the DESCRIBE command to represent the table structure
9.DUAL is a ' pseudo-table ' that can be used to test functions and expressions
This article from the "Ah Cheng Blog" blog, reproduced please contact the author!
Oracle Foundation Note One