mysql-5.7

How to select values from JSON in mysql

不问归期 提交于 2019-11-27 07:33:05
问题 Hi can anyone tell me what is wrong with this query. DECLARE @json LONGTEXT; SET @json = '[ { "name":"John Smith", "address":"780 Mission St, San Francisco, CA 94103"}, { "name":"Sally Brown", "address":"75 37th Ave S, St Cloud, MN 94103"}, { "name":"John Johnson", "address":"1262 Roosevelt Trail, Raymond, ME 04071"} ]'; ##SELECT @json; SELECT * FROM JSON_TABLE (@json, '$[*]' COLUMNS ( name VARCHAR(40) PATH '$.name', address VARCHAR(100) PATH '$.address')); Error that i get is You have an

Stored procedure raising “incompatible with sql_mode=only_full_group_by” despite sql_mode being blank

断了今生、忘了曾经 提交于 2019-11-26 21:41:59
问题 I have a stored procedure that ran fine on MySQL 5.6. During a recent server migration we upgraded to MySQL 5.7.19. My stored procedure now throws the error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'utility-monitor.daily_readings.building_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by: CALL monthly_readings(2017, 1, NULL, 1, 1)) I've set the sql_mode to "" via the