-
Notifications
You must be signed in to change notification settings - Fork 109
FR: Select single fields from substring search or split results #747
Comments
@creachadair Right now you can use
@smola having this implemented is it worth it implement |
@ajnavarro Since we have |
I have run into another case where The obvious way to do this is to do an autojoin on I could write a program, but it seems unfortunate that we don't have a good way to get properly-typed values out of these denormalized fields. Arguably this is better solved with a schema change, but that's probably a lot more work (and maybe not worth it—this problem is mostly a demonstration case for me, not a blocking work item). Anyway, just another datum on that while I'm working with it. |
maybe implementing JSON inline selectors: https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_json-inline-path or just |
I would like to be able to split a string and select one of the fields. The
SPLIT
function returns a JSON array, so I can't use that directly. There is aSUBSTRING
function, but there does not appear to be any way to find the offset of a partition (what MySQL callsLOCATE
orPOSITION
).One way to address this would be to give
SPLIT
an optional third parameter, so thatAnother would be to add a
LOCATE
(orFIND
orPOSITION
orINDEX
) function to find the offset of a subfield, e.g.,The first is probably better, since
LOCATE
would probably want a "skip" parameter anyway to specify which of the matches to stop on. But the second would also work.The text was updated successfully, but these errors were encountered: