Created
March 12, 2018 16:18
-
-
Save harisankarh/4d3fec704ccfe200cdbc7ad492976837 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *, | |
SUM(d0*dscores_0) OVER () AS dw2_00, | |
SUM(d0*dscores_1) OVER () AS dw2_01, | |
SUM(d1*dscores_0) OVER () AS dw2_10, | |
SUM(d1*dscores_1) OVER () AS dw2_11, | |
SUM(dscores_0) OVER () AS db2_0, | |
SUM(dscores_1) OVER () AS db2_1, | |
CASE | |
WHEN (d0) <= 0.0 THEN 0.0 | |
ELSE (dscores_0*w2_00 + dscores_1*w2_01) | |
END AS dhidden_0, | |
CASE | |
WHEN (d1) <= 0.0 THEN 0.0 | |
ELSE (dscores_0*w2_10 + dscores_1*w2_11) | |
END AS dhidden_1 | |
FROM {inner subquery} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment