读书人

|M| Sql查询计算数据 求方法解决方法

发布时间: 2012-01-12 22:11:58 作者: rapoo

|M| Sql查询计算数据 求方法
table
id apple applecount orange orangecount
1 15 2 10 5

查出表格式如下

id apple applecount orange orangecount tatil
1 15 2 10 5 80

谢谢

[解决办法]
select id,apple, applecount, orange, orangecount,(apple * applecount + orange * orangecount) as tatil from table

读书人网 >asp.net

热点推荐