我正在使用SQL select,而部分查询位于
之下var nodes:[SKNode] = SKNodes();
nodes.append(SKNode());
nodes[0].position = CGPoint(x: 100, y: 100) //should work
它返回4列
SELECT coalesce(C2.PRE,0) as PRE,coalesce(C4.PREX,0) as PREX,
coalesce(C2.AFTER,0) as AFTER, coalesce(C4.AFTERX,0) as AFTERX
我尝试在SQL SELECT中添加3个列,这3列是根据上面的列找到一些SUM值
1 0 0 0
并返回结果
PRESUM =(PRE+PREX) = 1+0=1
AFTERSUM =(AFTER+AFTERX) =0+0=0
TOTAL =PRESUM+AFTERSUM)= 1+0=1
The new SQL is
SELECT coalesce(C2.PRE,0) as PRE, coalesce(C4.PREX,0) as PREX,
coalesce(C2.AFTER,0) as AFTER, coalesce(C4.AFTERX,0) as AFTERX,
coalesce((PRE+PREX),0) as PRESUM
coalesce((AFTER+AFTERX),0) as AFTERSUM
coalesce((PRESUM+AFTERSUM),0) as TOTAL
但是最后3列[PRESUM,AFTERSUM,TOTAL]应该返回1 0 0.我计算总和的方式有什么不对
答案 0 :(得分:3)
进行算术运算时,GraphServiceClient
会产生NULL
值。所以,你可能想要这个:
NULL