Beautifier fails to parse code section

Arky

Member²
Hello

The Beautifier fails to parse the following piece of code:

SELECT d.dlr_id,
d.x_shop_cd,
row_number() over(PARTITION BY d.x_shop_cd
ORDER BY CASE WHEN dc.dlr_id IS NULL THEN 1 ELSE 2 END, d.dlr_id) rn
FROM dealers d

A workaround for this is to add brackets:

SELECT d.dlr_id,
d.x_shop_cd,
row_number() over(PARTITION BY d.x_shop_cd
ORDER BY (CASE WHEN dc.dlr_id IS NULL THEN 1 ELSE 2 END), d.dlr_id) rn
FROM dealers d

Can you please add it to the bug's list? I use 32-bit version (until PasteOptions for 64-bit arrives :grin: ) , Version 11.0.5.1775

Thanks!
 
Funny that you have to add brackets to help the beautifier. In this example you have to remove them:

SQL:
select x from y join z on (a = b and c = d and e = f)

I know they are redundant and I never put them there, but for some reason a lot of developers insist on adding them, and it messes up the beautifier.
 
Back
Top