Viewing 15 posts - 6,001 through 6,015 (of 10,143 total)
You're welcome, thanks for the generous feedback 🙂
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
July 27, 2012 at 8:43 am
L' Eomot Inversé (7/26/2012)
ChrisM@Work (7/26/2012)
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
July 27, 2012 at 8:22 am
GigiMi (7/27/2012)
I need to put everything (values for next and previous) in only one row, if possible.Luigi
Ah I see, sorry my mistake. Try this:
SELECT l.ID, l.Dateref, n.ID, n.Dateref
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
July 27, 2012 at 8:04 am
GigiMi (7/27/2012)
(more recent than any other record) I'd like to obtain something like this:
PreviousID - PreviousDateRef - NetxID - NextDateRef
25...
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
July 27, 2012 at 7:48 am
GigiMi (7/27/2012)
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
July 27, 2012 at 7:32 am
Here's a couple of ways:
DROP TABLE #Sample
CREATE TABLE #Sample (ID int, DateRef datetime, GroupID int)
INSERT INTO #Sample (ID, DateRef, GroupID)
SELECT 17, '2012-06-20 10:00:00.000', 463 UNION ALL
SELECT 21, '2012-06-22 12:00:00.000',...
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
July 27, 2012 at 7:21 am
Heya Pauliepoos, haven't seen you posting for ages!
SQL Kiwi (7/27/2012)
ChrisM@Work (7/27/2012)
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
July 27, 2012 at 6:57 am
You've probably cracked this now Anthony, with Lynn's code.
You could do this with a QU on the output but you'd have a new column with an incrementing string until...
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
July 27, 2012 at 6:17 am
Lynn Pettis (7/27/2012)
Oh, and the expected results based on the sample data.Thanks.
Lynn, just out of curiosity - because I don't know and "a developer should always know" - do you...
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
July 27, 2012 at 2:46 am
Jeff Moden (7/26/2012)
ChrisM@Work (7/26/2012)
WayneS (7/26/2012)
You'll might find this interesting: http://www.sqlperformance.com/2012/07/t-sql-queries/split-stringsVery interesting. Thanks, Wayne.
I know I enjoyed it. Gave me a chance to try out my new 4 band porkchop...
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
July 27, 2012 at 2:44 am
anthony.green (7/27/2012)
John's solution just run again took 8mins 8 secondsLynn's solution as used in a iTVF took 18 minutes 26 seconds.
How many rows are you working with? It would be...
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
July 27, 2012 at 2:11 am
WayneS (7/26/2012)
You'll might find this interesting: http://www.sqlperformance.com/2012/07/t-sql-queries/split-strings
Very interesting. Thanks, Wayne.
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
July 26, 2012 at 8:50 am
CROSSTAB and FOR XML PATH would be the most popular around here, there are loads of examples on ssc. FWIW there's a similar thread here.
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
July 26, 2012 at 8:29 am
L' Eomot Inversé (7/23/2012)
ChrisM@Work (7/23/2012)
SQLRNNR (7/23/2012)
C6H12O66-(hydroxymethyl)oxane-2,3,4,5-tetrol
Jason's C6H12O6 is a nasty ambiguous formula. ChrisW's thing is less ambiguous (but still ambiguous).
There's a nasty ambiguous word for it: hexose; but it's...
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
July 26, 2012 at 8:10 am
Eric M Russell (7/26/2012)
Lynn Pettis (7/25/2012)
Eric M Russell (7/25/2012)
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
July 26, 2012 at 7:34 am
Viewing 15 posts - 6,001 through 6,015 (of 10,143 total)