Viewing 15 posts - 376 through 390 (of 2,645 total)
I think the script in the article is a bit of a non-starter.
It is calculating the square root multiple times for each row.
June 14, 2023 at 3:23 pm
You only need to test up to the square root of a number to test for primality, which is quite a saving:
declare @n ...
June 14, 2023 at 1:48 pm
For exhaustive methods it's quicker to only look at odd numbers. There was a Youtube video a little while ago where they compared all different programming languages to determine...
June 14, 2023 at 11:57 am
I wrote this SQL Server table valued function a few years ago. It returns all the prime numbers less than 1 million in about 1 second.
June 14, 2023 at 9:32 am
Thank you, Jonathan. Almost every step in the execution plan now marked as "No Join Predicate" and the whole function now costs 100% with my original tally one...
June 13, 2023 at 6:45 pm
Thank you, Phil - the execution plan is the same. And same as with my tally table, 94% of it goes on INSERT INTO @t table
You don't need to...
June 13, 2023 at 4:16 pm
;WITH CTE AS
(
SELECT oven,
T.Hours,
...
June 6, 2023 at 1:16 am
Got no idea if this will work as you haven't posted any consumable data:
;WITH CTE AS
(
SELECT System,
...
June 5, 2023 at 10:03 pm
Python needs indentation to work.
June 5, 2023 at 10:07 am
Thanks for the reply. This query took over 3 minutes to run and it still didn't produce a result so I cancelled it. The run time on this one...
June 5, 2023 at 1:09 am
This is an equivalent query
SELECT T4.UNDERLYING_SYMBOL,
T4.QUOTE_DATE,
T4.EXPIRATION,
T4.ROOT_SYMBOL
...
June 4, 2023 at 10:30 pm
Your SQL looks a bit odd. There is no point in ordering by something you are partitioning by. You have Car, Direction in the partition and also in the order...
June 2, 2023 at 5:43 pm
SELECT y.ArriveDate, y.Car, x.arrival, x.direction, x.totalIn, x.totalOut, x.StationId, x.StationName
FROM [Ridership].[dbo].[Rail2019] x
INNER JOIN (SELECT DISTINCT ArriveDate, Car
...
June 2, 2023 at 1:12 am
SELECT rp.*
FROM returned_products rp
WHERE rp.returned_products_reason NOT LIKE '%reason_[2-3]%'
;
June 1, 2023 at 1:01 am
Viewing 15 posts - 376 through 390 (of 2,645 total)