JSON 객체를 탐색해서 들어가면 값을 조회할 수 있다.
JSON 데이터의 값을 조회하려면 ->와 ->>를 사용해야 한다.
->는 JSON 배열이나 JSON 객체를 반환하고
->>는 JSON 배열이나 객체를 텍스트로 반환한다.
meta->'sns'->>'facebook'처럼 사용할 수는 있지만
meta->>'sns'->'facebook'처럼은 사용할 수 없다.
#>는 배열 내의 값을 조회하는 오퍼레이터이다
https://blog.outsider.ne.kr/1061
PostgreSQL의 JSON 데이터 타입 오퍼레이터 :: Outsider's Dev Story
[PostgreSQL](http://www.postgresql.org/) 9.2부터 JSON 데이터 타입이 추가되어서 칼럼에 JSON 객체를 저장할 수 있다. 이는 아주 유용한 기능인데 RDB의 기능을 그대로 쓰면서 NoSQL처럼 Schemaless의 이점을...
blog.outsider.ne.kr
https://www.postgresql.org/docs/9.3/functions-json.html
JSON Functions and Operators
Table 9-40 shows the operators that are available for use with JSON (see Section 8.14) data. Table 9-40. JSON Operators Operator Right Operand Type Description Example -> int Get JSON array element '[1,2,3]'::json->2 -> text Get JSON object field '{"a":1,"
www.postgresql.org
'Developing.. > DE:SQL,log' 카테고리의 다른 글
Data Center란 무엇인가 (0) | 2022.07.28 |
---|---|
로그에 대한 모든 것 (0) | 2022.05.30 |
Data Engineering - 기초용어 및 데이터 시스템 이해 (0) | 2022.05.05 |