0

如何在 SQL 中使用横向视图从 JSON 字符串中提取值?

表“人”中的示例数据:

name   information
-----  -----------------------
Jen    {"age": 15, "gender":2}
John   {"age": 22, "gender":1}
Jack   {"age": 25, "gender":1}
Pat    {"age": 55, "gender":3}
4

1 回答 1

0
SELECT name , info\
FROM people\
LATERAL VIEW explode(information) exploded_information_view AS info

应该是这样的:

name / info

Jen    /   "age": 15 \
Jen     /  "gender":2
于 2020-07-28T23:31:56.807 回答