Question : I’m creating a pseudo-random data set for application users to train on. I’m surprised that if I seed […]
Tag: random
Fetch one value from random row where value is not x
Question : I have a games table in my db, which has id column(pk) and slug column(unique) – other columns […]
mysql – select random rows with max 3 rows per parent id
Question : I currently have a query that returns a maximum of 3 rows per parent_id. I want to enhance […]
How Can Get Random 2 rows FROM EACH GROUP FROM JOINED TABLE
Question : EXAMPLE Table Dept: dept_id dept_name dept_status ————————————— 1 Sales 1 2 Develpment 1 3 HR 1 4 QA […]
Result occurs often with fast random select query
Question : I have this query to display 4 random photos on a website (I have it from here (when […]
Randomly select 4 items of a randomly selected category
Question : I need an idea how to construct this query. I have a web page. each time the page […]
Duplicating rows based on a count column SQL Server [duplicate]
Question : This question already has answers here: Expanding a dataset based on a weight field (4 answers) Closed 2 […]
How can I generate a random bytea
Question : I would like to be able to generate random bytea fields of arbitrary length (<1Gb) for populating test […]
Generating a Random Account Number
Question : For privacy purposes, I need to derive an “Account Number” field that contains a random number, ranging from […]
How to (optimally) get random sample of (a.id, b.id) pairs from two tables (a, b)?
Question : Let’s assume I have to very simple tables CREATE TABLE a(id integer PRIMARY KEY, t timestamp default now(), […]