Viewing 15 posts - 2,386 through 2,400 (of 10,144 total)
g.britton (6/24/2015)
Greg Larsen (4/27/2015)
Comments posted to this topic are about the item <A HREF="/articles/Stairway+Series/125504/">Stairway to Advanced T-SQL Level 6: Creating Rows Of Data Using The UNPIVOT Operator</A>
Consider using CROSS APPLY...
June 25, 2015 at 7:45 am
GilaMonster (6/25/2015)
I found a photo of my Siamese.*sniff*
I'm very sorry for your loss.
June 25, 2015 at 6:54 am
bugg (6/25/2015)
ChrisM@Work (6/25/2015)
SELECT
rn = ROW_NUMBER() OVER(PARTITION BY s.fruit ORDER BY s.Preference),
max_rn = COUNT(*) OVER(PARTITION BY s.fruit),
s.*,
p.OrderQuantity
INTO #StreamedData
FROM @tmp s
INNER JOIN @purchase...
June 25, 2015 at 4:34 am
Yes, or this which looks a little cleaner:
SELECT
rn = ROW_NUMBER() OVER(PARTITION BY s.fruit ORDER BY s.Preference),
max_rn = COUNT(*) OVER(PARTITION BY s.fruit),
s.*,
p.OrderQuantity
INTO #StreamedData
FROM @tmp s
INNER JOIN @purchase p
ON...
June 25, 2015 at 4:01 am
bugg (6/25/2015)
ChrisM@Work (6/24/2015)
I wonder how a rCTE version would fare, in terms of performance?
Very cool 🙂
I've amended the code to pull in unassigned order quantities similar to spaghetti's output 🙂
DECLARE...
June 25, 2015 at 3:11 am
sreeram.sivakumar 61990 (6/24/2015)
...The prior max should be calculated based on source and destination keys.
Please list the rules for the calculation.
June 25, 2015 at 3:02 am
dwain.c (6/25/2015)
BWFC (6/25/2015)
Chattering?! What a great word for that vocalization! I know immediately what you are talking abut.
Did you read that somewhere or come up with it on your own?...
June 25, 2015 at 2:00 am
mw112009 (6/24/2015)
...THE SQL syntax was fine!
The query is at stage 1 of the three stages of SQL development:
1. Make it work
2. Make it fast
3. Make it pretty (formatting and documentation)
Don't...
June 25, 2015 at 1:47 am
I think your query should look something like this:
SELECT
T.RDW_PATIENT_ID,
x.PE_DVT
FROM #t T
CROSS APPLY (
SELECT STUFF( (
SELECT ',[<' + CONVERT( CHAR(8), s.ActivityDate, 112 ) + '>' + s.TermDescription +...
June 24, 2015 at 10:03 am
It's a bad idea as Drew points out, but it's not difficult to do. It's an unusual requirement and often it's a step in a process which would be difficult...
June 24, 2015 at 8:50 am
samartel (6/24/2015)
I have...
June 24, 2015 at 8:26 am
spaghettidba (6/24/2015)
ChrisM@Work (6/24/2015)
I wonder how a rCTE version would fare, in terms of performance?Brilliant! Works like a treat!
I've recently implemented a solution here which is essentially the same as the...
June 24, 2015 at 6:59 am
Minaz Amin (6/24/2015)
I will test on DEV first and follow up with all the env.
Can you post the Actual Execution Plan as a .sqlplan attachment? This would help folks evaluate...
June 24, 2015 at 6:04 am
I wonder how a rCTE version would fare, in terms of performance?
DECLARE @tmp TABLE (fruit VARCHAR(50), shop VARCHAR(10), preference INT, InStock INT)
INSERT INTO @tmp (fruit,shop,preference,InStock) VALUES ('orange','shop 1',1 ,4)
INSERT INTO...
June 24, 2015 at 5:35 am
Jeff Moden (6/22/2015)
Eirikur Eiriksson (6/22/2015)
ChrisM@Work (6/22/2015)
Alvin Ramard (6/22/2015)
GilaMonster (6/22/2015)
June 24, 2015 at 3:43 am
Viewing 15 posts - 2,386 through 2,400 (of 10,144 total)