Viewing 15 posts - 2,326 through 2,340 (of 10,143 total)
DavidDroog (7/22/2015)
thanks for the replies.
...
@chrism-2 - Yes, it does look complicated and there may be a couple of unecessary joins, but it works fine without the addition of the...
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 23, 2015 at 1:43 am
The original query appears to be "For each client, get all the products and all their colours". The other tables in the query could filter the output by geography but...
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 22, 2015 at 2:18 am
Sean Lange (7/16/2015)
SQLRNNR (7/16/2015)
Sean Lange (7/16/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
July 17, 2015 at 1:47 am
Or rather this:
-- This table holds account positions data that are appended to multiple times a day
-- what is the efficient way to retrieve the first set of positions...
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 15, 2015 at 7:12 am
-- Determine the most recent load_id, use it as a filter.
-- It will be about as fast as it can get without adding
-- additional indexes because load_id is the leading...
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 15, 2015 at 6:56 am
Instead of updating the temp table, why not calculate the value when you populate it, like this:
SUM(DayCount) OVER(PARTITION BY Loss_State)
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 15, 2015 at 1:46 am
TomThomson (7/13/2015)
Lynn Pettis (7/13/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
July 14, 2015 at 7:02 am
jghali (7/13/2015)
1. the execution plans of the Row_number for:
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY [UPC], [LocGroup] ORDER BY PriceLvl) FROM #Master_TAB
SELECT *, rn =...
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 13, 2015 at 7:26 am
Firstly, ROW_NUMBER() doesn't necessarily invoke a sort. Compare the execution plan of these two queries:
SELECT *, rn = ROW_NUMBER() OVER(PARTITION BY [UPC], [LocGroup] ORDER BY PriceLvl) FROM #Master_TAB
SELECT *, rn...
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 13, 2015 at 5:44 am
-- The outer query makes little sense, it only adds duplicate rows to a set which you're eliminating rows from
SELECT MT.A3+MT.A4 AS A34, MT.A3
-- ,M.*
FROM Master_TAB M
JOIN...
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 10, 2015 at 9:34 am
HerryMarkowitz (7/10/2015)
ChrisM@Work (7/10/2015)
HerryMarkowitz (7/10/2015)
But I dont want to see 102, 103, 104, 105, 106 lines in the sql code.
I want 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
July 10, 2015 at 6:47 am
HerryMarkowitz (7/10/2015)
But I dont want to see 102, 103, 104, 105, 106 lines in the sql code.
I want a loop 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
July 10, 2015 at 6:35 am
HerryMarkowitz (7/10/2015)
I am so sorry but my English is not perfect.Let me tell you what I understand;
A loop code is possible but not efficient.
Is that what you told?
The code I...
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 10, 2015 at 6:17 am
HerryMarkowitz (7/10/2015)
Thanks for the codes.
But your codes are not what I want.
Maybe I am not able to explain my needs because I am very new with SQL coding.
Let me...
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 10, 2015 at 5:26 am
HerryMarkowitz (7/10/2015)
Thanks for re-organized that code.
But my main question is about how to shorten that code.
I mean I dont want to enter every line from INVENNO 101 to INVENNO...
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 10, 2015 at 4:05 am
Viewing 15 posts - 2,326 through 2,340 (of 10,143 total)