Viewing 15 posts - 3,346 through 3,360 (of 10,143 total)
The execution plans for those two queries is likely to be completely different. If you were to write the query as a single "catch-all" query, it would be optimised either...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 14, 2014 at 8:31 am
/* You missed out the ddl for table #C, the ReleaseNumber on the
last row of your sample data is probably incorrect, and your spec is sloppy
and...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 14, 2014 at 5:22 am
Luis Cazares (5/13/2014)
It should be interpreted the same way as Chris M's query.
SELECT MeteriD,
Reading = SUM(Reading),
DateByHour =...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 9:19 am
ashok84.kr (5/12/2014)
...number of rows returned = 1 million and time taken 35 seconds....
How are you timing this? It could take 35 seconds just to return this number of rows to...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 6:19 am
Try this article on Dynamic Crosstabs[/url].
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 6:14 am
haddoque2000 (5/13/2014)
...Sample rows:
FinKeyDateKeyOrgaKeyCliKeyAccoKeyDim1KeyDim2KeyAmountDate
19720101001113611-541261,822010-10-01 00:00:00.000
19820101031113611-541261,822010-10-31 00:00:00.000
19920101101113611-550252,822010-11-01 00:00:00.000
20020101201113611-559243,822010-12-01 00:00:00.000
20120110131113611-568234,822011-01-31 00:00:00.000
2022004050611117116103332004-05-06 00:00:00.000
2032004050711117111436942004-05-07 00:00:00.000
204200405101111711-1466222004-05-10 00:00:00.000
205200405111111711-1595222004-05-11 00:00:00.000
...
Had you read the article suggested by Jeff and others you would have posted this as INSERTs. We're now...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 2:24 am
Megha P (5/13/2014)
create Table #temp
(MeteriD INT,
ReadingDate DATETIME,
Reading INT
)
INSERT #temp
SELECT 3969,'1/01/2014 0:00', 0
UNION ALL
SELECT 3969,'1/01/2014 0:15', ...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 2:04 am
Eirikur Eiriksson (5/12/2014)
Lynn Pettis (5/12/2014)
Eirikur Eiriksson (5/12/2014)
ChrisM@Work (5/12/2014)
Eirikur Eiriksson (5/12/2014)
Mike Saunders NL (5/12/2014)
The only thing that is missing is that the days with no events are not...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 13, 2014 at 1:48 am
Eirikur Eiriksson (5/12/2014)
Mike Saunders NL (5/12/2014)
The only thing that is missing is that the days with no events are not mentioned. Is there a way to display...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 9:44 am
Hi Luis
Sorry mate, answered here. I hadn't noticed this thread or I would have put up a dupe notice.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 8:47 am
;WITH DateRange AS (
SELECT EventDate
FROM (
SELECT
FirstDate = DATEADD(month,DATEDIFF(month,0,MIN(startdate)),0),
LastDate = DATEADD(month,1+DATEDIFF(month,0,MAX(enddate)),-1)
FROM #events
) e
CROSS APPLY (
SELECT TOP(1 + DATEDIFF(day,e.FirstDate,e.LastDate))
EventDate = DATEADD(day,ROW_NUMBER() OVER(ORDER BY (SELECT NULL))-1,FirstDate)
FROM
(VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) d (n),...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 7:54 am
Can you set up some sample data for folks to code against? Coding up a running totals script is easy. Trying to imagine how your data looks before and after...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 7:06 am
SELECT
'INSERT INTO ' + t2.table_name + CHAR(10) +
' (' + STUFF([target].ColumnList,1,2,'') + ')' + CHAR(10) +
'SELECT ' + STUFF([source].ColumnList,1,2,'') + CHAR(10) +
'FROM ' +...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 4:59 am
hoseam (5/12/2014)
Yes, any columns in the Hosea_tblDef_Cloning_Table, under the column [COLUMN_NAME], will be the combination.. In our select list selecting new values and where clause comparing with old values..
Just to...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 2:53 am
hoseam (5/12/2014)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
May 12, 2014 at 2:42 am
Viewing 15 posts - 3,346 through 3,360 (of 10,143 total)