10.6 버전에 새로 추가된 함수 같습니다.
개발할때 유용하게 사용할것 같아서
소개드립니다.
아시는분들은 아시겠지만 모르시는 분들을 위해서 정보 공유합니다.
활용 예1)
[code]
set @json='
[
{"name":"Laptop", "color":"black", "price":"1000"},
{"name":"Jeans", "color":"blue"}
]';
select * from json_table(@json, '$[*]'
columns(
name varchar(10) path '$.name',
color varchar(10) path '$.color',
price decimal(8,2) path '$.price' )
) as jt;
[/code]
활용 예2)
[code]
SELECT * FROM data_table t1, JSON_TABLE(
t1.words, '$.123456.*' COLUMNS (word TEXT PATH '$')
) AS jt;
+------------------------------------------------------------------------------+-------+
| words | word |
+------------------------------------------------------------------------------+-------+
| {"123456":{"first":"hello","second":"there"}, "78910":{"first":"All good?"}} | hello |
| {"123456":{"first":"hello","second":"there"}, "78910":{"first":"All good?"}} | there |
+------------------------------------------------------------------------------+-------+
[/code]
게시글 목록
| 번호 | 제목 |
|---|---|
| 16801 | |
| 16798 | |
| 16796 | |
| 16795 | |
| 16791 | |
| 16790 | |
| 16785 | |
| 16777 | |
| 16776 | |
| 16766 | |
| 16760 | |
| 16759 |
JavaScript
전화번호 및 휴대번호 자동하이픈(-)
2
|
| 16740 | |
| 16737 | |
| 16735 | |
| 16728 | |
| 16713 |
PHP
PHP Router
17
|
| 16700 | |
| 16691 | |
| 16669 | |
| 16668 |
MySQL
특정 row의 index 값 구하기
5
|
| 16660 | |
| 16655 | |
| 16654 | |
| 16647 | |
| 16639 | |
| 16637 | |
| 16634 | |
| 16629 | |
| 16620 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기