Viewing 15 posts - 1,621 through 1,635 (of 4,085 total)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 5, 2017 at 9:47 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2017 at 2:57 pm
By definition, a relationship connects two or more objects. That means that you have to have at least one object on each side of the relationship, which means that you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2017 at 1:32 pm
This only takes one scan of the table whereas the other two solutions require two.
;
WITH leaderboard AS
(
select
ROW_NUMBER() OVER (order by Value desc)...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2017 at 12:48 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2017 at 12:00 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2017 at 11:50 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2017 at 3:06 pm
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2017 at 12:48 pm
Since a table represents a set, an empty table represents the empty set { }, so the value of any aggregate is either NULL or zero.
GROUP BY defines...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2017 at 12:37 pm
First, sample data should be provided as an INSERT statement into your sample table.
The solution below uses a tally table. There is a blazing fast inline table-valued function...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2017 at 10:02 am
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2017 at 3:12 pm
If I understand what you want. This will give it to you.
SELECT TOP 1 firstMonday
FROM
(
VALUES
(0, CAST(DATEADD(MONTH, DATEDIFF(MONTH, 6, GETDATE()), 6) AS DATE))
, (1,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2017 at 2:53 pm
Here is another solution.
SELECT ID,
(PATINDEX('%1%',(
SELECT
CAST([2017_07] AS BIT)
, CAST([2017_06] AS BIT)
, CAST([2017_05] AS BIT)
, CAST([2017_04] AS BIT)
, CAST([2017_03] AS BIT)
, CAST([2017_02] AS BIT)
, CAST([2017_01]...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2017 at 12:16 pm
If it's available, you can easily shred the XML query plan for the SQL statement to find any referenced tables.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 29, 2017 at 6:58 am
Have you checked the end-of-record delimiter. It could be LF, CR, or CR/LF.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 28, 2017 at 3:02 pm
Viewing 15 posts - 1,621 through 1,635 (of 4,085 total)