By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
INSERT 0 4
CREATE TABLE
INSERT 0 3
CREATE FUNCTION
| id | reference | job_title | status |
|---|---|---|---|
| 2 | 1 | bar2_job | defabc |
| 2 | 1 | bar_job | abc |
| 1 | 1 | foo_job | abc |
SELECT 3
| id | reference | job_title | status |
|---|---|---|---|
| 2 | 1 | bar2_job | defabc |
| 2 | 1 | bar_job | abc |
| 1 | 1 | foo_job | abc |
SELECT 3