无聊的6.9

select vend_name || '(' || vend_country || ')'--把这两列调出来并且country加()
from Vendors
order by vend_name;

--同上的作用,会去掉中间所有的空格
select RTRIM(vend_name) || '(' || RTRIM(vend_country) || ')'
from Vendors
order by vend_name;

select RTRIM(vend_name) || '(' || RTRIM(vend_country) || ')'--赋予列别名
          as vend_title
from vendors--不区分大小写
order by vend_name;

--执行计算
select prod_id,quantity,item_price,
quantity*item_price AS expanded_price
from OrderItems
where order_num =20008;

你可能感兴趣的:(数据库学习笔记)