Viewing 15 posts - 721 through 735 (of 1,228 total)
mic.con87 (12/22/2011)
I focus on the...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 23, 2011 at 6:07 am
mic.con87 (12/22/2011)
...As for the more efficient
inner joinGROUP BY query, results are lost when compared to the one previously posted.
and how do the counts compare to the query "apply...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 7:50 am
mic.con87 (12/22/2011)
The Query runs. The count is still incorrect but I'm assuming there is still another stage;-)....
How are you measuring this?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 7:47 am
mic.con87 (12/22/2011)
So far so good, cqv.QuestionDate < it.discoverdate holds for all cases 🙂
You might get away with the following as a more efficient alternative to the inner select - give...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 6:24 am
Good - then apply the next level:
SELECT
d.NameID,
NoOfSOSCalls = COUNT(*)--,
--Reported_SOS = MAX(ISNULL(CASE WHEN d.QuestionID = 202 THEN d.Answer ELSE NULL END,0))
FROM (
SELECT
cc.NameID,
--cqv.QuestionDate,
--it.discoverdate,
cqv.ClaQuestionHistoryID,
MAX_ClaQuestionHistoryID = MAX(cqv.ClaQuestionHistoryID) OVER(PARTITION BY cqv.ClaCaseID,...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 6:19 am
mic.con87 (12/22/2011)
The query returns results however they are incorrect. I had to change the alias cc.QuestionDate to cqv.QuestionDate...The count doesn't seem to take into account cqv.DiscoverDate < it.discoverdate...
They will...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 5:57 am
mic.con87 (12/22/2011)
it.QuestionClassID will never be the same as...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 5:30 am
mic.con87 (12/22/2011)
No results are returned even if I do comment out the where clause...
Okaaaay...comment out the join to the temp table, it's the only change left. Also, please post the...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 4:34 am
Sure. Focus on the inner SELECT:
SELECT
cc.NameID,
cqv.QuestionID,
cqv.Answer,
cqv.ClaQuestionHistoryID,
MAX_ClaQuestionHistoryID = MAX(cqv.ClaQuestionHistoryID) OVER(PARTITION BY cqv.ClaCaseID, cqv.QuestionID, cqv.QuestionClassID)
FROM Staging.ClaCases cc
INNER JOIN #InitialTable_24 it ON it.NameID = cc.NameID
INNER JOIN StagingViews.ClaQuestionView cqv
ON...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 4:24 am
Dev (12/22/2011)
ChrisM@home (12/22/2011)
Dev (12/21/2011)
"Doctor & Mrs. Johnathan van Huron Esq. - DO, MD, MVP"
Title FName LName Degree
Agree on Names but Titles & Degrees shouldn't be in...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 4:03 am
mic.con87 (12/22/2011)
I'm not sure what you mean by "Also, can you change the column...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 3:29 am
mic.con87 (12/22/2011)
My problem is I need to add condition: where CTE.QuestionDate < it.discoverdate
Now obtaining CTE.QuestionDate is a problem. When I use this in the Group By clause in the 'FROM...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 3:00 am
Hello
The first query in your post shows a LEFT JOIN, but there are references to columns from it in the WHERE clause, resulting in an INNER join.
Written slightly differently, it...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 2:34 am
Dev (12/21/2011)
"Doctor & Mrs. Johnathan van Huron Esq. - DO, MD, MVP"
Title FName LName Degree
Agree on Names but Titles & Degrees shouldn't be in source data.
Try telling that...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 1:53 am
Jeff Moden (12/21/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 22, 2011 at 1:45 am
Viewing 15 posts - 721 through 735 (of 1,228 total)