本文介绍了在SQL Server 2008中循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的编码员,

我有以下查询..

触发查询时,我得到以下数据:

UNITECH
旁遮普语
JPASSOCIAT
HDIL
DENABANK
KOKUYOCMLN
ASHOKLEY
IOB

现在我想做的是,当我得到这些数据时,我想一一对应地根据我上面得到的值来一一更新记录.

例如,获取上述记录后,我想根据公式更新一些列.所有这些记录的公式都相同.

基本上这是股票名称,我想根据情况更新股票移动AVG.

可以在一个查询中完成吗?

致谢.

Dear Coders,

I have following query..

I get following data when i fire a query:

UNITECH
PUNJLLOYD
JPASSOCIAT
HDIL
DENABANK
KOKUYOCMLN
ASHOKLEY
IOB

Now what i want to do is when i get this data then one by one i want to update the records one by one based on the values which i got above.

For e.g.After getting the above records i want to update some columns based on formula.The formula will be same for all these records.

Basically this are stock names & i want to update the stock moving AVG based on the condition.

Can this done in one query?

Thanks & Regards.

推荐答案


这篇关于在SQL Server 2008中循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:09