For the newbies: quick way I'll get a sample of rows (without weights) in Redshift:
`SELECT * FROM sales ORDER BY RANDOM() LIMIT 10;`
For the newbies: quick way I'll get a sample of rows (without weights) in Redshift:
`SELECT * FROM sales ORDER BY RANDOM() LIMIT 10;`
Been working with sqlite and Typescript, needing random rows sampled reproducibly with a seed. Found this handy little trick [0]. Not the cleanest, but it works!
`SELECT * FROM sales ORDER BY substr(${seedValue} * sales.id, length(sales.id) + 2) LIMIT 10;`
[0] https://stackoverflow.com/questions/24256258/order-by-random...