Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Happy happy joy joy

Johan Rex johanrex

💭
Happy happy joy joy
  • Helsingborg, Sweden.
View GitHub Profile
View SQL moving average.sql
WITH cte
AS (SELECT
1 AS n -- anchor member
,Cast(Cast(CRYPT_GEN_RANDOM(4) as INT) as Float) AS rnd
UNION ALL
SELECT
n + 1 -- recursive member
,Cast(Cast(CRYPT_GEN_RANDOM(4) as INT) as Float)
FROM cte
View gist:b6b501dfb29c65fd90b3033989acf509
DECLARE @nrRows INT;
SET @nrRows=1000000;
--drop table if exists tmp;
create table tmp
(
idString varchar(36)
);