Viewing 15 posts - 136 through 150 (of 325 total)
Assuming you don't want the overall total that WITH ROLLUP would give you.
Select
EmpID,
Yr,
Sum(Sales)
From @Table
Group By Grouping Sets ((EmpID,Yr),(EmpID))
Having Grouping_ID(EmpId,...
August 29, 2018 at 3:01 pm
I'm not sure there is a generalised ideal solution to the problem, but there probably some general rules you could apply. Any party with an odd number of members needs...
August 29, 2018 at 1:38 pm
If you actually want the name/number combos to retain some sort of sequencing you have to resort to some fairly horrible code to work around the limitations of XPath...
August 29, 2018 at 12:01 pm
For an ad-hoc query, you can just use a table or table variable:
August 29, 2018 at 12:49 am
Where and how are you getting the data to insert? It's likely it's being truncated somewhere before you actually insert it.
August 28, 2018 at 11:23 am
But 2018-03 is both a fixed width and entirely unambiguous and yet completely devoid of absolutely every single issue that 2018-03-00 suffers from. The SQL standard can completely bypass the...
August 27, 2018 at 3:13 pm
If you want it as an output format, fine but 99% of non programmers won't have a clue what it means. As an input format, for the same reason, it...
August 27, 2018 at 12:32 pm
Do something like this:
With UnpivotRows As
(
Select
… maths goes here...
From …
Cross Join
(
Select 0 As YearsAgo, @DateFrom as DateFrom,...
August 27, 2018 at 5:38 am
If it were me, I'd have wanted to run some pretty extensive load testing on it before getting that close to launch so that I was aware of how much...
August 25, 2018 at 3:28 pm
August 24, 2018 at 11:03 pm
Make the original query a derived table and then calculate the percentages from that, i.e. something like:
SELECT
ClaimType,
Submitted,
ApprovedPaid,
Declined,
...
August 24, 2018 at 10:53 pm
String_Split won't work in this case because it provides no guarantees about the order of rows, so it will happily split 3/4 into 3 and 4 but your can't tell...
August 23, 2018 at 12:14 am
Declare @Inches Table
(
TextVersion Varchar(10)
)
August 22, 2018 at 8:14 pm
Are all users connecting to the same SQL Server? Are they all running queries in the same database? If not, are all databases at the latest compatibility level?
August 22, 2018 at 3:32 pm
Viewing 15 posts - 136 through 150 (of 325 total)