Viewing 15 posts - 2,326 through 2,340 (of 4,087 total)
There are two variants of the CASE expression: the simple CASE expression and the searched CASE expression. You are mixing the two.
When using the simple CASE expression, the comparison...
September 29, 2016 at 3:42 pm
mcfarlandparkway (9/28/2016)
This is what the...
September 28, 2016 at 2:09 pm
SELECT v.*
FROM (
VALUES
(1, 'True', 'True', 'True', 'True', 'True', 'True'),
(2, 'True', 'True', 'True', 'True', 'True', 'True'),
(3, 'True', 'True', 'True', 'True', 'True', 'True'),
(4, 'True', 'True', 'True', 'False', 'False', 'True'),
(5, 'True', 'True', 'True',...
September 28, 2016 at 9:16 am
J Livingston SQL (9/27/2016)
drew.allen (9/27/2016)
September 28, 2016 at 8:46 am
You're strings/dates aren't quoted. You should always try to run your query before posting it on the Internet.
Drew
September 28, 2016 at 8:39 am
Infock12 (9/28/2016)
You expert opinion is much appreciated.
I am running a report that covers the last two fiscal years. I want all the data for the last two years. The...
September 28, 2016 at 8:15 am
Okay, is it just me? I've seen two different people post sample data where the datetime data is given in hex and converted to datetime. It's not like...
September 27, 2016 at 3:31 pm
Ken McKelvey (9/27/2016)
One way is to expand the dates with a number/tally table and then roll them up again:
The problem with this approach is that it can be very expensive,...
September 27, 2016 at 3:16 pm
dimpythewimpy (9/27/2016)
SUM(Col2) OVER(ORDER BY Col1 ROWS UNBOUNDED PRECEDING) "Rows" FROM #TMP
basically...
September 27, 2016 at 11:37 am
rishakin (9/26/2016)
Problem Statement:
I have 2 tables say Table1 and Table2. They both have fields Number and type. But the numbers across the table should be reordered sequential when user clicks...
September 27, 2016 at 10:18 am
ZZartin (9/27/2016)
WITH TEMP_CTE AS(SELECT NameFrequency.Name, NameFrequency.Role, RoleRankLookup.Priority, SUM(NameFrequency.Count) AS TOTAL, RANK() OVER(PARTITION BY NameFrequency.Name ORDER BY SUM(NameFrequency.Count) DESC, RoleRankLookup.Priority ASC) AS RN
FROM (VALUES('Jack', 'Student', 3),
('Jack', 'Teacher', 5),
('Jack', 'Admin', 2),
('Jack', 'Student',...
September 27, 2016 at 9:48 am
Jacob Wilkins (9/27/2016)
The Dixie Flatline (9/26/2016)
you should specify the window frame (generally ROWS UNBOUNDED PRECEDING), because the default is RANGE UNBOUNDED PRECEDING, and which is much slower than specifying...
September 27, 2016 at 9:10 am
Luis Cazares (9/26/2016)
I, however, can see a lack of understanding of SQL....
September 26, 2016 at 3:49 pm
pietlinden (9/26/2016)
SUM( <column to be summed> )...
September 26, 2016 at 3:27 pm
dimpythewimpy (9/26/2016)
begin
case
when (condition1 and condition...
September 26, 2016 at 3:25 pm
Viewing 15 posts - 2,326 through 2,340 (of 4,087 total)