Line Break / Bug
torsten.strauss
Posts: 271 Silver 3
in SQL Prompt
Hi Regate Team,
I did not find any solution to ensure the line break will look like this
before
[code]
SELECT
shipperid, YEAR(shippeddate) AS shipyear, COUNT(*) AS numorders
FROM
Sales.Orders
GROUP BY
GROUPING SETS((shipperid, YEAR(shippeddate)), (shipperid), (YEAR(
shippeddate
)), ());
shipperid, YEAR(shippeddate) AS shipyear, COUNT(*) AS numorders
FROM
Sales.Orders
GROUP BY
GROUPING SETS((shipperid, YEAR(shippeddate)), (shipperid), (YEAR(
shippeddate
)), ());
[/code]
after
[code]
SELECT
shipperid, YEAR(shippeddate) AS shipyear, COUNT(*) AS numorders
FROM
Sales.Orders
GROUP BY
GROUPING SETS((shipperid, YEAR(shippeddate)), (shipperid),
(YEAR(shippeddate)), ());
shipperid, YEAR(shippeddate) AS shipyear, COUNT(*) AS numorders
FROM
Sales.Orders
GROUP BY
GROUPING SETS((shipperid, YEAR(shippeddate)), (shipperid),
(YEAR(shippeddate)), ());
[/code]
It seems that the general! issue is that the line break will not work correctly when the setting Wrap lines long than (80) characters. It is not the expected behavior because after the line break the code has again 80 (in my example) characters to place the remaining code.
It would be nice to see a fix - thanks!
Torsten
Tagged:
Answers
SELECT
CustomerKey
, YEAR(OrderDate) AS OrderYear
, SalesAmount
, LEAD(SalesAmount, 1, 0) OVER (PARTITION BY CustomerKey
ORDER BY
YEAR(OrderDate)
)
FROM
FactInternetSales
WHERE
SalesTerritoryKey = 1
AND YEAR(OrderDate) = 2014;
it should look something like this
Can you share your format style file with us?
Tianjiao Li | Redgate Software
Have you visited our Help Center?
thanks for looking into this!
Please find attached the style.
Torsten
Thanks for your patience!
The development team has triaged this issue. We accept this isn't right, but there are more impact issues we are currently working on so I'm afraid this behaviour won't get changed any time soon.
We apologize for the inconvenience caused.
Tianjiao Li | Redgate Software
Have you visited our Help Center?