Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
持久列是否可以引用另一个持久列,是否有任何规则,例如它们是按顺序计算持久字段还是至少计算其他列引用的字段?
不,计算列不能引用其他计算列。只需重复您要引用的表达式。
这里没有从左到右的评估顺序。例如
CREATE TABLE T ( B AS A*2 PERSISTED, A INT )
即使出现在它之后的计算列B引用也能正常工作。A
B
A