Viewing 15 posts - 2,566 through 2,580 (of 10,143 total)
You can probably figure it out from this:
SELECT *, [GroupBy] = TestDate - rn
FROM (
SELECT *, [rn] = ROW_NUMBER() OVER(PARTITION BY TestId ORDER BY TestDate)
FROM tblDatesSequenceTest
) d
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
March 18, 2015 at 7:32 am
appdev13 (3/18/2015)
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
March 18, 2015 at 7:24 am
rexyrexin (3/18/2015)
select * from mytable
where class='something'
AND ISNULL(xyz,0) = CASE WHEN @abc = 1 THEN 1 ELSE ISNULL(xyz,0) END
Here @abc is the stored procedure parameter .
Thanks all for...
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
March 18, 2015 at 7:09 am
GilaMonster (3/18/2015)
Luis Cazares (3/17/2015)
Can someone help with a crystal ball or interrogation system for this thread?http://www.sqlservercentral.com/Forums/Topic1668185-391-1.aspx
Sorry, mine's broken, it's only showing clouds.
You're holding it upside down:-P
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
March 18, 2015 at 3:24 am
chris.rogers00 (3/16/2015)
DECLARE @date DATE,
@string VARCHAR(5)= 'test'
BEGIN TRAN
PRINT XACT_STATE()
BEGIN TRY
-- see if the data I've been given can be cast...
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
March 17, 2015 at 8:08 am
Then try SUBSTRING(string, startpos, 8000) or calculate the correct length for the third parameter.
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
March 17, 2015 at 7:43 am
sqlquery29 (3/17/2015)
We have like after 40 characters the unit of measure is place in the description field. We have more than one space between the description and unit of...
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
March 17, 2015 at 6:42 am
WolfgangE (3/16/2015)
thank you for the answer.
I know I could optimize the index, but that's not the point. I'd like to understand why optimizer is estimating the way it does...
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
March 16, 2015 at 10:55 am
Try these indexes:
CREATE INDEX ix_MasterId_Etc ON DetailTable (MasterId, CreateDate) INCLUDE (DetailId)
CREATE INDEX ix_MasterId_Etc ON MasterTable (Name, MasterId)
These are a first guess based on the join columns, filters and output...
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
March 16, 2015 at 10:05 am
APPLY has been a part of TSQL since 2005. Read more here:
http://www.sqlservercentral.com/articles/APPLY/69953/%5B/url%5D
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
March 13, 2015 at 10:13 am
-- Check
WITH SequencedData AS (
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY emp ORDER BY rdate DESC)
FROM #sample
)
SELECT *
FROM SequencedData s
CROSS APPLY (SELECT TOP 1 * FROM #sample si...
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
March 13, 2015 at 9:37 am
measterbro (3/13/2015)
SET @DynamicPivotQuery = @part1 + @part2 +...
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
March 13, 2015 at 7:54 am
measterbro (3/12/2015)
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
March 13, 2015 at 7:46 am
measterbro (3/13/2015)
Msg 207, Level 16, State 1, Line 15
Invalid column name 'LeagueName'.
Msg 207, Level 16, State 1, Line 16
Invalid column name 'ShortName'.
Msg 207, Level 16,...
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
March 13, 2015 at 7:43 am
aaron.reese (11/14/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
March 13, 2015 at 7:36 am
Viewing 15 posts - 2,566 through 2,580 (of 10,143 total)