Requirements: Before, I used instr() in Oracle to achieve the requirements, but now I want to use MySQL to achieve the same effect, and try to use the functions in MySQL to achieve it.
INSTR(A.SOME_THING.B,".",1,2)<>0 --ORACLE
Requirements: Before, I used instr() in Oracle to achieve the requirements, but now I want to use MySQL to achieve the same effect, and try to use the functions in MySQL to achieve it.
INSTR(A.SOME_THING.B,".",1,2)<>0 --ORACLE
2
Answers
As far as I can tell, that’s not that difficult for simple cases. But, as number of parameters raises, MySQL "replacement" for the same Oracle functionality gets worse.
As your code:
means
some_thing
you can’t do that in a simple manner using MySQL, as you’ll need a user-defined function. Something like this (source is INSTR Function – Oracle to MySQL Migration; I suggest you have a look at the whole document. I’m posting code here because links might get broken):
Use it as
and get 6 as a result.
In OracleDB the code
checks does the column contains at least 2 point chars in the value.
In MySQL this can be replaced with, for example,