Viewing 15 posts - 1,471 through 1,485 (of 10,144 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
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...
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)
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...
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 '+')
June 23, 2016 at 6:41 am
kyagi.jo (6/23/2016)
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 😀
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...
June 23, 2016 at 5:31 am
kyagi.jo (6/23/2016)
June 23, 2016 at 5:15 am
What might be typical inputs and outputs of this code?
June 23, 2016 at 5:02 am
squvi.87 (6/23/2016)
Luis Cazares (6/22/2016)
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...
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...
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
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...
June 22, 2016 at 9:24 am
Viewing 15 posts - 1,471 through 1,485 (of 10,144 total)