本文介绍了SQL - 基于计算字段的计算字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两列连接 A&B,这样做是为了找出客户 ID.然后我需要在该计算字段上做一个 case 语句.可以一次性完成吗?
Hi I have two columns which I concatenate A&B, this is done to figure out the customer ID.I need to then do a case statement on that calculated field.Can it be done in one go?
Column A
Column B
Column C = Column A & Column B
Column D = Case When (column C) = 001-002 then XXXX
D 列不起作用.问题是,如果 C 列是计算字段,那么我可以在单个查询中计算出 C 列以给出 D 列吗?
Column D is not working. The question is if column C is a calculated field, can I then calculate off column C to give column D, in a single query?
谢谢
推荐答案
你应该这样做...因为计算列不会帮助进一步计算
You should do it in this way...as calculated columns is not going to help in further calculation
Column A
Column B
Column C = Column A & Column B
Column D = Case When (Column A & Column B) = 001-002 then XXXX
这篇关于SQL - 基于计算字段的计算字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!