We can use the JSON operators in WHERE clause to filter the returning rows. And then info->'items'->'product' returns all products as text. ORDER BY product Code language: SQL (Structured Query Language) ( sql )įirst info -> 'items' returns items as JSON objects. For example, the following statement returns all products sold: SELECT info -> 'items' -> 'product' as product The following query uses the operator -> to get all customers in form of JSON: SELECT info -> 'customer' AS customerįROM orders Code language: SQL (Structured Query Language) ( sql )Īnd the following query uses operator -> to get all customers in form of text: SELECT info -> 'customer' AS customerīecause -> operator returns a JSON object, you can chain it with the operator -> to retrieve a specific node.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |