python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to Consistently Return 2.5% of a Result Set using NEWID() and Table Variable?
I'm using the NEWID() approach to obtain a sample of records from my population. I've created a table variable to define my population and I need to consistently return 2.5% of records from it. The ...
SidC
Votes: 0
Answers: 0
Is it possible to calculate the total sum within partition and cumulative sum between partitions?
I am interested in calculating a descending cumulative sum based on groups, however, I want the cumulative sum to be based on the grouping. In other words, I want the total sum within a group and cumu...
nwaldo
Votes: 0
Answers: 3
Combining two different Queries out put in one XML
I need to produce a report that will be emailed so I am using XML format. I an currently producing the mail below and now have been asked to add a summary to the top. My SQL XML knowledge is lacking w...
WIlliam Burke
Votes: 0
Answers: 1
Is there a way to use IN and it evaluate values left to right in T-SQL?
Simplified example:
select top(1) team.points
from teams
where team.ID = '123' and team.season IN ('2021', '2015', '2010')
I have been searching and cannot find a solid answer on this. I want to use...
CamParker
Votes: 0
Answers: 2