SELECT
GROUP_CONCAT(
CONCAT(
CONCAT("{\"userName\": \"", userName, "\""),
CONCAT(", \"email: \"", email, "\"}")
)
)
AS json FROM User;
利用SQL语句直接得到JSON
时间: 2024-11-07 23:21:09
SELECT
GROUP_CONCAT(
CONCAT(
CONCAT("{\"userName\": \"", userName, "\""),
CONCAT(", \"email: \"", email, "\"}")
)
)
AS json FROM User;
利用SQL语句直接得到JSON