Viewing 15 posts - 721 through 735 (of 1,229 total)
-- check first using the corresponding SELECT:
SELECT a.*, b.*, c.*
from locn a
join acs b on a.[lid]=b.[lid]
join aco c on c.[uid]=b.[uid]
where c.[type]='c'
December 26, 2011 at 3:54 am
mic.con87 (12/22/2011)
I focus on the...
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...
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?
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...
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,...
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...
December 22, 2011 at 5:57 am
mic.con87 (12/22/2011)
it.QuestionClassID will never be the same as...
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...
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...
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...
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...
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...
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...
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...
December 22, 2011 at 1:53 am
Viewing 15 posts - 721 through 735 (of 1,229 total)