JSON
Data type and usages
Description
Sample Source Patterns
JSON Literals
JSON 'json_formatted_data'Sample Source
CREATE OR REPLACE TABLE test.jsonType
(
COL1 JSON
);
INSERT INTO test.jsonType
VALUES
(JSON'{"name": "John", "age": 30, "city": "New York"}'),
(JSON'{"name": "Alice", "age": 28, "city": "San Francisco"}');
SELECT JSON'{"name": "John", "age": 30, "city": "New York"}';
CREATE OR REPLACE TABLE test.jsonType
(
COL1 VARIANT
);
INSERT INTO test.jsonType
SELECT
PARSE_JSON('{"name": "John", "age": 30, "city": "New York"}')
UNION ALL
SELECT
PARSE_JSON('{"name": "Alice", "age": 28, "city": "San Francisco"}');
SELECT
PARSE_JSON('{"name": "John", "age": 30, "city": "New York"}');
Last updated
Was this helpful?