By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
INSERT 0 7
| tbl_id | string |
|---|---|
| 1 | a really nice application |
| 2 | apples are cool |
| 3 | appliances |
| 5 | apple has boring applications to apply |
| 6 | apple apple |
SELECT 5
| tbl_id | string |
|---|---|
| 1 | a really nice application |
| 2 | apples are cool |
| 3 | appliances |
| 5 | apple has boring applications to apply |
| 6 | apple apple |
SELECT 5
| tbl_id | string | matches |
|---|---|---|
| 5 | apple has boring applications to apply | 3 |
| 6 | apple apple | 2 |
| 2 | apples are cool | 1 |
| 3 | appliances | 1 |
| 1 | a really nice application | 1 |
SELECT 5
| tbl_id | string | matches |
|---|---|---|
| 5 | apple has boring applications to apply | 3 |
| 6 | apple apple | 2 |
| 2 | apples are cool | 1 |
| 3 | appliances | 1 |
| 1 | a really nice application | 1 |
SELECT 5