By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 4 Duplicates: 0 Warnings: 0
| id | lead | status | searchAddressId |
|---|---|---|---|
| 1 | 1 | address-search | 1 |
| 2 | 2 | fresh | 1 |
| 3 | 3 | completed | 1 |
| 4 | 4 | suspended | 1 |
Records: 10 Duplicates: 0 Warnings: 0
| id | lead | status | searchAddressId |
|---|---|---|---|
| 1 | 1 | fresh | 1 |
| 2 | 1 | address-search | 1 |
| 3 | 1 | address-search | 1 |
| 4 | 2 | fresh | 1 |
| 5 | 2 | fresh | 1 |
| 6 | 3 | fresh | 1 |
| 7 | 3 | completed | 1 |
| 8 | 4 | fresh | 1 |
| 9 | 4 | completed | 1 |
| 10 | 4 | suspended | 1 |
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\' at line 35
FUNCTION fiddle.calcFreshLeadSearchId does not exist