sql求积怎么破?

hejunheng 2013-10-09 05:21:12
select product_count, product_price from [order] where [user_id]=4078



表里有N行,每行有2列 数量(product_count)、价格(product_price)每行小计怎么求积,


数量、价格 小计
3 12.80 ?
8 13.90 ?
4 13.90 ?
6 13.90 ?
2 10.90 ?
5 9.80 ?
...全文
239 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
select  product_count as 数量, 
        product_price as 价格,
        product_count * product_price as 小计
from [order] 
where [user_id]=4078
Landa_Jimmy 2013-10-09
  • 打赏
  • 举报
回复

select  product_count, product_price,product_count*product_price '小计' from [order] 
唐诗三百首 2013-10-09
  • 打赏
  • 举报
回复

select product_count,
       product_price,
       (product_count*product_price) '小计'
 from [order] 
 where [user_id]=4078
MrYangkang 2013-10-09
  • 打赏
  • 举报
回复


select  product_count, product_price ,

(product_count * product_price) as money

from [order] where [user_id]=4078


27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧