Window Functions and Group By Auto-fill
tonywaddle
Posts: 17 Bronze 2
Hi,
I've just seen that Window functions can be incorrectly populated in the 'group by' portion of a SQL statement when the partition portion of the function is populated.
For instance the following group by was auto-filled, and produces an invalid statement:
When trying to reproduce this error, the auto-fill started to only add the 'value' column (which is also incorrect - it should populate attribute and value) but using Refresh Suggestions command reverted it back to populating the window function as above.
Thanks,
Tony
I've just seen that Window functions can be incorrectly populated in the 'group by' portion of a SQL statement when the partition portion of the function is populated.
For instance the following group by was auto-filled, and produces an invalid statement:
SELECT Attribute, Value, COUNT(*) OVER (PARTITION BY a.Attribute), COUNT(*) FROM #Attribute a INNER JOIN #Value v ON v.Col = a.col AND a.a = v.Sec GROUP BY COUNT(*) OVER (PARTITION BY a.Attribute), a.Attribute, v.Value
When trying to reproduce this error, the auto-fill started to only add the 'value' column (which is also incorrect - it should populate attribute and value) but using Refresh Suggestions command reverted it back to populating the window function as above.
Thanks,
Tony
Comments
Thanks for your post! We've managed to reproduce this issue here and are working on a fix now.
Thanks,
James
Redgate Software