Viewing 15 posts - 3,706 through 3,720 (of 10,143 total)
Thanks Alan. I should point out that it's quite a long way from being a full Levenshtein implementation! I don't think it would be impossible - just too costly.
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
January 28, 2014 at 6:17 am
Gail's suggestion using DENSE_RANK() is well worth a try when you get time.
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
January 28, 2014 at 3:01 am
mote.ajit2 (1/27/2014)
Earlier I was collecting data in some temporary table so that I can use it as input to query on main table. Now I have removed that...
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
January 28, 2014 at 1:40 am
;WITH SampleData AS (
SELECT MyDate = CAST('2014-01-27 05:59:59.997' AS DATETIME) UNION ALL
SELECT '2014-01-27 06:00:00.000' UNION ALL
SELECT '2014-01-27 06:00:00.003' UNION ALL
SELECT '2014-01-27 17:59:59.994' UNION ALL
SELECT '2014-01-27 17:59:59.997' UNION ALL
SELECT '2014-01-27 18:00:00.000')
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
January 27, 2014 at 2:06 am
They're very narrow triangles - having dealt with this in the near past. Nevertheless, with two of them ORred together, the optimiser will likely choke. Try splitting them up and...
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
January 27, 2014 at 1:51 am
Jeff Moden (1/25/2014)
wit_jp2001 (1/24/2014)
I will try out the new query this afternoon. Just so that eveyone knows this process is to update the 1st SKU with the heaviest ...
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
January 27, 2014 at 1:45 am
DaveDB (1/24/2014)
"Perhaps the reason for my request for additional material is becoming clearer now.
The fact that accomplished professionals, who would usually be able 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
January 24, 2014 at 9:30 am
rabih_karam (1/24/2014)
"To calculate the number of days between date1 and date2, you can use either Day of year ("Y") or Day ("D"). When interval is Weekday ("W"), DateDiff...
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
January 24, 2014 at 7:30 am
wit_jp2001 (1/24/2014)
I will try out the new query this afternoon. Just so that eveyone knows this process is to update the 1st SKU with the heaviest SKU. ...
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
January 24, 2014 at 6:41 am
Does the stored procedure reference the Customers table?
Try to keep your code simple:
SELECT
h.company_no,
h.invoice_no,
h.invoice_locn,
h.invoice_type,
a.item_no as Kit_Ref_group,
b.item_no ,
max(CASE WHEN A.invoice_qty > B.invoice_qty THEN 0 ELSE A.invoice_qty END) as sales ,
b.invoice_qty - (CASE...
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
January 24, 2014 at 6:35 am
Anytime.
Third row up in my sig block has links to a couple of outstanding articles on APPLY. Well worth a read.
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
January 24, 2014 at 6:25 am
CROSS APPLY is an excellent tool for building complex WHERE clauses and would also help you to figure out if it's worthwhile building up an exclusion table as suggested. Once...
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
January 24, 2014 at 6:02 am
Dennis Post (1/24/2014)
If you have nolock, then you have the potential for dirty reads, duplicate rows and missed rows and it doesn't matter (for the latter 2) that each process...
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
January 24, 2014 at 4:28 am
Grant Fritchey (1/24/2014)
Nice job Chris. I'd love to see what the execution plan of the original query looked like.
Thanks Grant. Me too, there are over 70 reads of the lookup.
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
January 24, 2014 at 4:01 am
IgorMi, you can use http://extras.sqlservercentral.com/prettifier/prettifier.aspx.
I tend not to. If I'm about to spend a few minutes reading and understanding a chunk of code, reformatting it easily becomes part 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
January 24, 2014 at 4:00 am
Viewing 15 posts - 3,706 through 3,720 (of 10,143 total)