Reputation: 3568
This statement is part of a larger statement but this past is not work. It throws the usual 1064 error. The goal is to parse a string to get at the number that is in the middle of it, then to cast this to an int so that said number can be compared against other id values. This is the failing query
SELECT CAST(REPLACE(REPLACE('remove_this-151-remove_this_too', 'remove_this-', ''), '-remove_this_too', '') as INTEGER);
I'm not sure why this type of syntax is not allowed. Thank you to anyone who can help.
Upvotes: 2
Views: 91