bug 1005326 - fix sql syntax for correlations