clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591678 fiddles created (45713 in the last week).

CREATE TABLE tablename ( id INT GENERATED ALWAYS AS IDENTITY, Data VARCHAR(5), Date DATE, Time TIME ); INSERT INTO tablename (Data, Date, Time) VALUES ('Data1', '2020-08-19', '13:00:00'), ('Data1', '2020-08-19', '13:30:00'), ('Data1', '2020-08-19', '14:00:00'), ('Data1', '2020-08-21', '07:00:00'), ('Data1', '2020-08-21', '07:30:00'), ('Data2', '2020-08-20', '08:00:00'), ('Data2', '2020-08-20', '08:30:00'), ('Data1', '2020-08-19', '13:00:00'), ('Data1', '2020-08-19', '13:30:00'), ('Data1', '2020-08-19', '14:00:00'), ('Data1', '2020-08-21', '07:00:00'), ('Data1', '2020-08-21', '07:30:00'), ('Data2', '2020-08-20', '08:00:00'), ('Data2', '2020-08-20', '08:30:00'), ('Data1', '2020-08-19', '13:00:00'), ('Data1', '2020-08-19', '13:30:00'), ('Data1', '2020-08-19', '14:00:00'), ('Data1', '2020-08-21', '07:00:00'), ('Data1', '2020-08-21', '07:30:00'), ('Data2', '2020-08-20', '08:00:00'), ('Data2', '2020-08-20', '08:30:00'), ('Data1', '2020-08-19', '13:00:00'), ('Data1', '2020-08-19', '13:30:00'), ('Data1', '2020-08-19', '14:00:00'), ('Data1', '2020-08-21', '07:00:00'), ('Data1', '2020-08-21', '07:30:00'), ('Data2', '2020-08-20', '08:00:00'), ('Data2', '2020-08-20', '08:30:00');
28 rows affected
 hidden batch(es)


select * from (select *, ntile(10) over(order by random()) as percentile from tablename) as A where percentile=1
id data date time percentile
18 Data1 2020-08-21 07:00:00 1
10 Data1 2020-08-19 14:00:00 1
3 Data1 2020-08-19 14:00:00 1
 hidden batch(es)