I have a table called DISCOUNT_CODES with two columns, one having JSON values:
CODE ACTIVE
1234 {"active":"Y"}
2468 {"active":"N"}
1359 {"active":"Y"}
As the second column is in JSON, I was wondering if there was a way I can select the codes that are active without having to do a select query like:
SELECT CODE FROM DISCOUNT_CODES WHERE ACTIVE = '{"active":"Y"}';
In pseudo-code, I am wondering if something like this is possible:
SELECT CODE FROM DISCOUNT_CODES WHERE JSON(ACTIVE $.active) = "Y";
Edit: I am using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production