Using MySQL, having x = 'aa.bb.cc', how can I obtain the list 'aa.bb.cc', 'aa.bb', 'aa'?
With x = '39.01', the list is '39.01', '39'.
With x = '39.02.01.01', the list is '39.02.01.01', '39.02.01', '39.02', '39'.
From the last example above with x = '39.02.01.01', I would want to be able to construct something like:
SELECT ... FROM ... WHERE foo IN bar
where bar is dynamically obtained as ('39.02.01.01', '39.02.01', '39.02', '39').
Any ideas would be appreciated.
I hope
INSTRorLOCATEfunctions may work for you:or
Here
barcan be39.02.01.01andfoocan be a substring e.g.'39.02.01.01', '39.02.01', '39.02', '39'.