By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
inventory_id |
---|
3049 |
(1525) not in ( select inventory_id from rental where return_date is null ) |
---|
1 |
(3049) not in ( select inventory_id from rental where return_date is null ) |
---|
0 |
(9999) not in ( select inventory_id from rental where return_date is null ) |
---|
1 |
1 IN ( select i.inventory_id is not null from ( select 1525 inventory_id union all select 3049 inventory_id union all select 9999 inventory_id ) o left outer join ( select inventory_id from rental where return_date is null ) i using (inventory_id) ) |
---|
1 |