WITH NormCTE AS ( SELECT delta - avg(delta))/stddev(delta) AS deltaNorm , (echo - avg(echo))/stddev(echo) AS echoNorm , (foxtrot - avg(foxtrot))/stddev(foxtrot) AS foxtrotNorm FROM t_subs ) SELECT deltaNorm + echoNorm + foxtrotNorm AS normSum FROM NormCTE ORDER BY normSum DESC
I'm on Postgres 9.3.5, however I think my knowledge of Postgres is not deep enough to help me with this challenge, so here I am reaching out to the community !