I have a Mysql Table with a column called ACCOUNT_NUMBER that includes a transaction number I need to extract:
ACCOUNT_NUMBER
MB-MuchBetterDeposit-230-337882630--
CallCard-BankDeposit-350-337887834--
RealPay-Deposit-108-337894920--
PayMathod-WebDeposit-2-339163798--PAYMETHODAR
To extract the 9 figures number located between the delimiters '-' and '--' I use this in my query:
SUBSTR(ACCOUNT_NUMBER FROM ( locate('--',ACCOUNT_NUMBER)-9) FOR 9)
Which returns the value (337882630,337887834, etc...). Now, if I imagine that the length of the Tx will be increased in time from 9 to 10 or 11 figures, what would be the solution to accurately extract this Tx? I tried with locate but it gets messed up since '-' and '--' are very similar.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…