Viewing 15 posts - 691 through 705 (of 1,396 total)
Yes it could be put in the same function
March 18, 2021 at 11:16 am
Wow, that is so much faster. Thank you Steve. Now let me take a look to understand the code, is it the fnTally make it so much faster?
It's true...
March 17, 2021 at 6:31 pm
I will give it a try, so the fnTally is the one I can copy here? thanks
https://www.sqlservercentral.com/scripts/create-a-tally-function-fntally
That's the one I use. There are others out there and if you're...
March 17, 2021 at 4:42 pm
It seems the query is performing a partial cross join. The cross join could be replaced by a tally function and window (rows between 30 preceding and current row)...
March 17, 2021 at 2:21 pm
It seems safest to COUNT(DISTINCT CATEGORY) with GROUP BY PartId. It's not clear if it's necessary to join back to the table to SELECT other CategoryIds. If other CategoryIds (than...
March 15, 2021 at 9:22 pm
Suppose there's a table of weekend workdays with "Makeup day after St. Patricks Day" in it. The weekend workday(s) could be included in the query using OR EXISTS and a...
March 14, 2021 at 3:58 pm
Suppose there's a table of holidays with St Patrick's Day in it. The holiday(s) could be excluded in the query using WHERE NOT EXISTS and a correlated subquery. Because St...
March 12, 2021 at 9:23 pm
Yet another application where a tally function could be useful. The projection is off by $1.11 perhaps due to rounding
declare
@revMTD ...
March 12, 2021 at 8:38 pm
Each record has a PatID, Date, Doctor and upto four possible operation procedures (op1 to op4) that a patient may receive. There are 6 possible options for surgical procedure...
March 11, 2021 at 3:10 pm
Yeah, it sort of tastes like sausage... or that's how they get you to try it. They ask you "what's your least favorite meat?" Then tell you it sort of...
March 9, 2021 at 9:12 pm
select t2.*
from #map m
join #trades t1 on m.CodeValueFrom=t1.Code
...
March 9, 2021 at 9:00 pm
Spam is one thing but don't let anyone convince you to try scrapple. It's not "the same thing" it's not even "similar" 🙂
My father in-law made scrapple,...
March 9, 2021 at 12:43 pm
My father in-law made scrapple, and my oldest daughter loved it. I really don't remember if he made it for the younger two before he died.
I say to each...
March 9, 2021 at 12:30 pm
Spam is one thing but don't let anyone convince you to try scrapple. It's not "the same thing" it's not even "similar" 🙂
March 8, 2021 at 1:22 pm
It seems you're looking to include the ROW1 column in the GROUP BY and ORDER BY clauses but not in the SELECT list. Otherwise, it seems to be a standard...
March 5, 2021 at 6:57 pm
Viewing 15 posts - 691 through 705 (of 1,396 total)