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?.
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
id name
1 Clinton
2 Bush
3 Obama
4 Trump
5 Biden
SELECT 5
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
id student_id score
1 1 90
2 2 90
3 3 95
4 4 95
5 5 80
SELECT 5
id name score
1 Clinton 90
2 Bush 90
3 Obama 95
4 Trump 95
5 Biden 80
SELECT 5
id name score
3 Obama 95
4 Trump 95
1 Clinton 90
2 Bush 90
5 Biden 80
SELECT 5
id name score
3 Obama 95
4 Trump 95
1 Clinton 90
SELECT 3
max min
95 80
SELECT 1
score count
95 2
90 2
80 1
SELECT 3
id name score smilie
3 Obama 95 :)
4 Trump 95 :)
SELECT 2
id name score smilie
1 Clinton 90 :)
2 Bush 90 :)
SELECT 2