Reputation: 19
I have following records in my DB.
table= defense
id Atype
1 {"Domain_name":www.pgmobile.com , "attack": true, "probability": "9.53"}
2 {"Domain_name":www.fb.com , "attack": false , "probability": "3.35"}
3 {"Domain_name":www.pub.com , "attack": true, "probability": "8.34"}
I want to make where clause condition on Atype column. Where in column Atype attack is true...
e.g: select * from defense where attack= true // here some help needed
thanks for help.
Upvotes: 1
Views: 58
Reputation: 50
For {"Domain_Name": ["www.fb.com"], "attack": [false], "Probability": [0.001]}
query wil be use 'like'
SELECT *
FROM defense
WHERE JSON_EXTRACT(Atype, '$.attack') LIKE '[false]';
Upvotes: 0