- Joined
- May 27, 2021
- Messages
- 38
- Reaction score
- 8
This is the WHERE clause in my SQL statement:
3CX looks for anything wrapped in brackets and replaces it. For JSON_SEARCH, I'm doing a wildcard search and it detects the [*] as a replacement and completely removed it from the SQL statement.
I tried CONCAT to build the JSON search query but SQL just returns all entries as NULL.
How can this be resolved?
SQL:
WHERE JSON_EXTRACT(person, JSON_UNQUOTE(JSON_SEARCH(person, "one", '%123%', NULL, "$.phoneNumbers[*].canonicalForm"))) IS NOT NULL;
3CX looks for anything wrapped in brackets and replaces it. For JSON_SEARCH, I'm doing a wildcard search and it detects the [*] as a replacement and completely removed it from the SQL statement.
I tried CONCAT to build the JSON search query but SQL just returns all entries as NULL.
Code:
WHERE JSON_EXTRACT(person, JSON_UNQUOTE(JSON_SEARCH(person, "one", '%123%', NULL, CONCAT("$.phoneNumbers[", "*].canonicalForm")))) IS NOT NULL;
How can this be resolved?