Viewing 15 posts - 1,471 through 1,485 (of 10,143 total)
Simpler:
SELECT *
FROM (SELECT col1 = 1, col2 = 2, col3 = 3, col4 = 4) s
CROSS APPLY (
SELECT MAXmyval = MAX(d.myval)
FROM (VALUES (col1), (col2), (col3), (col4)) d (myval)
) x
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
June 24, 2016 at 5:26 am
BWFC (6/24/2016)
tindog (6/24/2016)
Beatrix Kiddo (6/24/2016)
Well, I'm embarrassed to be British now.I'm just shocked.
I can't believe it either.
Farrago has already admitted that the £350 million figure, upon which many people based...
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
June 24, 2016 at 4:29 am
GilaMonster (6/24/2016)
Ed Wagner (6/23/2016)
Phil Parkin (6/23/2016)
Jeff Moden (6/23/2016)
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
June 24, 2016 at 1:58 am
Or this:
DECLARE @pString VARCHAR(8000) = '-[ab]+[cd]-[ef]';
WITH E1(N) AS (
SELECT 1 UNION ALL SELECT...
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
June 23, 2016 at 7:06 am
Can it be any of these?
'-[ab]+[cd]-[ef]'
'+[ab]+[cd]-[ef]'
'[ab]+[cd]-[ef]' (first element defaults 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
June 23, 2016 at 6:41 am
kyagi.jo (6/23/2016)
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
June 23, 2016 at 6:29 am
Ed Wagner (6/23/2016)
Nice work, Chris. I like the way you handled the first element.
Haha! The OP doesn't 😀
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
June 23, 2016 at 6:27 am
Oh I see - I got completely the wrong end of the stick, I assumed you were looking for a means of speeding up the function. To that end, here'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
June 23, 2016 at 5:31 am
kyagi.jo (6/23/2016)
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
June 23, 2016 at 5:15 am
What might be typical inputs and outputs of this code?
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
June 23, 2016 at 5:02 am
squvi.87 (6/23/2016)
Luis Cazares (6/22/2016)
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
June 23, 2016 at 1:40 am
squvi.87 (6/23/2016)
"severe damage"?
How many rows are you expecting the query to return, and what consumes those rows?
250 MILLION
and what consumes those rows? What are you going to do with...
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
June 23, 2016 at 1:36 am
squvi.87 (6/22/2016)
ChrisM@Work (6/22/2016)
SELECTa.ID, a.TestDate, a.Score,
b.dt AS dates
FROM Calendartable b
OUTER APPLY (
SELECT TOP 1 a.ID, a.TestDate, a.Score
FROM testdata a
WHERE a.TestDate <= b.dt
ORDER BY a.TestDate DESC
) a
Test data is...
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
June 22, 2016 at 9:56 am
SELECT
a.ID, a.TestDate, a.Score,
b.dt AS dates
FROM Calendartable b
OUTER APPLY (
SELECT TOP 1 a.ID, a.TestDate, a.Score
FROM testdata a
WHERE a.TestDate <= b.dt
ORDER BY a.TestDate DESC
) a
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
June 22, 2016 at 9:38 am
Brandie Tarvin (6/22/2016)
Beatrix Kiddo (6/22/2016)
I'm f@*king terrified.
Me too, and ashamed of the xenophobes.
Back to SQL Server, I work for a company that has a lot of trading systems. We are...
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
June 22, 2016 at 9:24 am
Viewing 15 posts - 1,471 through 1,485 (of 10,143 total)