www.bersaty.com

Mysql基础2

拼接:

/*连接和使用别名*/
select concat(vend_name,'(',vend_country,')') as vend_title
from venders
order by vend_name;

执行算术计算:

/*quantity*item_price形成一个新列expanded_price*/
select prod_id,
          quantity,
          item_price,
          quantity*item_price as expanded_price
from orderitems
where order_num = 20005;

 

posted @ 2013-08-23 14:20  bersaty  阅读(163)  评论(0编辑  收藏  举报