I have a "changesets" table which has a comments column where people enter references to bug issues in the format "Fixed issue #2345 - ......", but can also be "Fixed issues #456, #2956, #12345 ...." what's the best way to select these reference numbers so i can access the issues via a join.
given this change sets table
id comments
===========================
1 fixed issue #234 ....
2 DES - #789, #7895, #123
3 closed ticket #129
i'd like results like this
changeset_id issue_id
=====================
1 234
2 789
2 7895
2 123
3 129
I've used substring_index(substring_index('#',-1),' ',1) type construct but that will only return a single reference per line.
Also looking for the most efficient way to do this text lookup
Any help appreciated
Thanks