我試着進行下面的查詢:SELECT AS問題
SELECT t1.[user1], t1.[user2],
(CAST(t1.[total_event_duration] AS DECIMAL))/(CAST (t2.[total_events_duration] AS DECIMAL)) AS buddy_strength
FROM [CDRs].[dbo].[aggregate_monthly_events] AS t1
INNER JOIN [CDRs].[dbo].[user_monthly_stats] AS t2
ON t1.[user1] = t2.[user1]
WHERE buddy_strength > 0.02
但它返回一個錯誤「無效的列名稱buddy_strength'」
有誰知道如何解決上面的查詢?
適用於普遍適用的快速修復。 – egrunin 2010-10-22 13:47:37
+1與重複整個表達式相比,這會有性能優勢嗎? – Patrick 2010-10-22 14:17:45
@帕特里克:不,在這種情況下,它是有效的短路 – gbn 2010-10-22 16:51:49