Hello,
I wish to search rows in my table on the basis of text of json keys.
My table has vouchercode, voucherdate, dramt, cramt.
Here dramt and cramt are both jsonb fields (postgresql 9.4).
dramt containes account and amount, same with cramt.
sample date.
vouchercode:1 ... dramt{"1":25,"2":25}
"1" and "2" are account codes.
there will be several such ros and I want to get only those rows where
either dramt or cramt contains accountcode as 1.
Note that accountcode is a key not the value of jsonb data.
so my sudo code for where is where dramt.key = '1'.
How can I achieve this?
I can loop through all vouchers and do a comparison but that is not
efficient and entirely defeating purpose of a select query.
Happy hacking.
Krishnakant.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.