반응형
- count(), count(distinct)
- group_concat()
- json_arrayagg() -> json array aggregate
- json_objectagg() -> json object aggregate
- sum(), max(), min()
select
device_type, region
,group_concat(ric_code,'-', country_code)
,JSON_ARRAYAGG(JSON_OBJECT('cntry',country_code, 'ric',ric_code))
,JSON_OBJECTAGG('cntry',country_code)
from tb_rc_ha_region group by device_type, region
반응형
'db' 카테고리의 다른 글
mysql 모든 table, key, index...etc 확인 (0) | 2022.05.19 |
---|---|
mysql change column error (0) | 2022.04.28 |
mysql timezone setting (0) | 2022.04.26 |
mysql 한글깨짐 (0) | 2022.04.26 |
mysql console 접속 (0) | 2022.04.26 |