SQL Prompt changes alias in order by clause
GregDodd
Posts: 12 Bronze 2
in SQL Prompt
I'm not sure if this is the right place to report a bug, but I'm seeing SQL Prompt (version 9.4.14.8687) change the table alias in an order by clause (doesn't affect the column list in the select, or join parameters, or column list in group by clause, only the order by).
A trivial example, say I type in the following query:
A trivial example, say I type in the following query:
<div>SELECT *</div><div>FROM Product</div><div>INNER JOIN Product AS p2</div><div> ON Product.ProductItemID = p2.ProductItemID</div><div>WHERE 1 = 2</div><div>ORDER BY product.ProductItemID</div><div> ,p2.ProductItemID</div><div></div>
When I format the code, SQL Prompt changes the product.ProductItemID in the Order By Clause to p2.ProductItemID:
Additional note - if I put an alias on the first table (which is probably a good idea for readability), it works fine. It's only if I alias one table but not the other.
SELECT * FROM Product INNER JOIN Product AS p2 ON Product.ProductItemID = p2.ProductItemID WHERE 1 = 2 ORDER BY p2.ProductItemID ,p2.ProductItemID
Additional note - if I put an alias on the first table (which is probably a good idea for readability), it works fine. It's only if I alias one table but not the other.
Tagged:
Answers
Ah it was you that reported this a while ago. I'll update that thread as well.