How to find if a field is contained in another field with Asterix '*' #1177
-
Given
which is surprising me. How can I construct a query to return 1? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
A way is to escape the
I have added |
Beta Was this translation helpful? Give feedback.
-
I have add a great suggestion in stack overflow from Kusalananda: to use
|
Beta Was this translation helpful? Give feedback.
-
Brilliant! I can't use the Unless you can propose something equally elegant, of course :-)-O |
Beta Was this translation helpful? Give feedback.
-
Sure, here is a
which results in the expected
slightly embellished for clarity, I eventually only need $Desc. |
Beta Was this translation helpful? Give feedback.
-
No, no, this was brilliant. Thank you and kusalananda so very much. Not only did this solve my problem, also taught me something :-)-O I’ll probably even refine it by checking for the $Counterparty as well :-)-O. This is part of reconciling a bank statement (here obviously bunq) with my accounting software (SQL-Ledger, but via csv2ofx, so it might even be interesting for users of accounting packages that can read OFX). The original $Description is too short, the concatenated one too long (when duplicated). |
Beta Was this translation helpful? Give feedback.
-
One can of course also look for "\x2A" if need be :-)-O |
Beta Was this translation helpful? Give feedback.
I have add a great suggestion in stack overflow from Kusalananda: to use
ssub
function, no regexing, no characters are special:if($b != ssub($b,$a,""))
, if after string replaceb
is not equal to itself, thena
is contained inb
.