计算具有条件的列中所有产品的平均成本和更新成本 [英] Count average cost and update cost of all products in column with conditions
本文介绍了计算具有条件的列中所有产品的平均成本和更新成本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,请帮我跟进:
我有桌子产品并具有以下任务:计算单位价格列中所有产品的估计成本和更新成本。如果当前价格>然后,如果< 10%。 + 20%
顺便说一下需要使用变量
请帮我写脚本我用SQL server 2000
谢谢大家之前。
Hi guys, please help me with following:
I have table "Products" and have following task: Count evarege cost and update cost of all products in column "UnitPrice" with conditions if current price > everage then -10% if < +20%
By the way need to use variables
Please help me to write script I use SQL server 2000
Thanks everybody before.
推荐答案
你有什么尝试?
这样的事情但不要'我不知道如何恢复
Somthing like that but don''t know how to resume
展开 | 选择 | Wrap | 行号
这是一个提示:您可以在一个CASE子句中使用更新声明
例如
Here is a tip: You can use a CASE clause in an update statement
e.g
展开 | 选择 | 换行 | 行号
这篇关于计算具有条件的列中所有产品的平均成本和更新成本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文