mysql 两列拼接 给新列命名 进行列与列之间的算术计算
选取两列
select vend_name,vend_country
from vendors;
如何将两列拼接 concat
select concat(vend_name,’(’,vend_country,’)’)
from vendors;
给拼接后的新列命名 as
select concat(vend_name,’(’,vend_country,’)’)
as vend_title
from vendors;
算术执行:
select 3*2; – 返回6
计算总花费*
select prod_id, quantity,item_price, quantity*item_price as expanded_price
from orderitems
where order_num = 20008;