使用SQL Server 2005按功能分组 [英] using sql server 2005 group by function

查看:69
本文介绍了使用SQL Server 2005按功能分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据表格式为

hi there, i have my data table in the format

Id   Name   score  value
1     x        50   1
2     y        20   3
3     z        36   5



我想使用类似
的sql查询设计器生成查询



I want to generate a query with a sql query designer that look like

Id   Name   score  value  Product
1     x        50   1       50
2     y        20   3       60
3     z        36   5       180



产品为得分*值

我该如何实现?
在此先感谢

您的马丁

[edit]已添加代码块-OriginalGriff [/edit]



Where product is score*value

How can i achieve this?
Thanks in advance

Your Martin

[edit]Code blocks added - OriginalGriff[/edit]

推荐答案

SELECT Id, Name, score, value, (score * value) AS Product FROM myTable


这篇关于使用SQL Server 2005按功能分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆