How to access a value of a dynamic key in memsql

40 Views Asked by At

I have a MemSQL database with a table:

MyTable

primaryId configuration
1 { [keyID]: { status: "open" } }
2 { [keyID]: { status: "closed" } }

The key keyID is a dynamic key e.g uuid that gets randomly generated whenever a new item is inserted into the table.

Is there a way to access the status value inside the configuration column in MemSQL. e.g:

SELECT primaryId, status
FROM MyTable
WHERE configuration::$[keyID]::$status IN ("open", "closed")

provided that I don't know what value the [keyID] might resolve to?

Any help is appreaciated, thanks.

0

There are 0 best solutions below