add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
5 rows affected
12 rows affected
id employee_id activity_type created_at
1 1 1 2020-11-18 07:10:25+00
2 2 1 2020-11-18 07:30:25+00
3 3 1 2020-11-18 07:50:25+00
4 2 2 2020-11-18 19:10:25+00
5 3 2 2020-11-18 19:22:38+00
6 1 2 2020-11-18 20:01:05+00
7 1 1 2020-11-19 07:11:23+00
8 1 2 2020-11-19 16:21:53+00
9 1 1 2020-11-19 19:11:23+00
10 1 2 2020-11-19 20:21:53+00
11 1 1 2020-11-20 07:41:38+00
12 1 2 2020-11-20 08:52:01+00
id name division_id
1 John 1
2 Amber 2
3 Mike 1
4 Jimmy 1
5 Kathy 2
the_date employee_id name division_id rows min_check_in max_check_out check_ins check_outs
2020-11-18 1 John 1 {1} 2020-11-18 15:10:25 null {15:10:25} null
2020-11-18 3 Mike 1 {3} 2020-11-18 15:50:25 null {15:50:25} null
2020-11-18 4 Jimmy 1 null null null null null
2020-11-19 1 John 1 {6,7} 2020-11-19 15:11:23 2020-11-19 04:01:05 {15:11:23} {04:01:05}
2020-11-19 3 Mike 1 {5} null 2020-11-19 03:22:38 null {03:22:38}
2020-11-19 4 Jimmy 1 null null null null null
2020-11-20 1 John 1 {8,9,10,11,12} 2020-11-20 03:11:23 2020-11-20 16:52:01 {03:11:23,15:41:38} {00:21:53,04:21:53,16:52:01}
2020-11-20 3 Mike 1 null null null null null
2020-11-20 4 Jimmy 1 null null null null null
created_date id name division_id rows min_time_in max_time_out check_ins check_outs
2020-11-19 08:00:00 1 John 1 {8,9,10} 2020-11-19 19:11:23+00 2020-11-19 20:21:53+00 {NULL,"2020-11-19 19:11:23+00",NULL} {"2020-11-19 16:21:53+00",NULL,"2020-11-19 20:21:53+00"}