SQL 第一课

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.

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值