1. Select * from table
练习:select * from po_lines_all
2. Select column1,column2 from table
练习:select last_update_date , po_header_id from po_lines_all
知识点:
• SQLstatements are not case sensitive.
SQL语句是不分大小写的
• SQLstatements can be on one or more lines.
SQL 语句可以在一行或者是多行
• Keywordscannot be abbreviated or split across lines.
关键字不能缩写或是拆分
• Clauses are usually placed on separate lines.
条款通常放在单独的线路上
• Indents are used to enhance readability.
缩进为了增强可读性
3. Arithmetic Expressions算数表达式
练习1:select last_update_date,unit_price,2 * (unit_price + 200)from po_lines_all
• Multiplication and division take priorityover addition and subtraction.
乘法和处罚优先于加法和减法
• Operatorsof the same priority are evaluated from left to right.
相同优先级别的运营商从左到右进行评估
• Parenthesesare used to force prioritized evaluation and to clarify statements.
用圆括号来强制优先评估,并澄清语句
练习2:select last_update_date,unit_price,2 * unit_price + 200 from po_lines_all
以上这个语句是吧()去掉之后,得到的数值是完全不同的,练习1为4400,练习2为4200.