[Mariadb] 10.7.0 버전에 새로 생긴 natural_sort_key()
이번에 mariadb 10.7.0버전에서 네추럴 정렬관련해서 기능추가가 되었다고합니다.
사용법은 order by 절에 natural_sort_key(정렬하고자하는 컬럼)을 넣어 주시면 됩니다.
아래 해당 예시는 단순 order by와 natural_sort_key로 정렬 했을때 차이를 보여 주시는 예시입니다.

참고 링크 : https://mariadb.org/10-7-preview-feature-natural-sort/
댓글 6개
4년 전
고생했던 부분 풀리는거 같아 좋네요. 정보 감사합니다.
4년 전
오, 이것은 귀하군요.
4년 전
10,7 만세네~~
4년 전
감사합니다.
해피정닷컴
4년 전
오호 매우 좋은 기능이네요
BiHon
4년 전
참고로 PHP에서는 natsort(), natcasesort() 함수가 같은 역할을 합니다. (PHP 4, 5, 7, 8)
+ natsort()
- https://www.php.net/manual/en/function.natsort.php
- http://docs.php.net/manual/kr/function.natsort.php
+ natcasesort()
- https://www.php.net/manual/en/function.natcasesort.php
- http://docs.php.net/manual/kr/function.natcasesort.php
$temp = [
'10.1.22',
'10.2.1',
'10.2.12',
'10.3.32',
'10.7.0',
'5.5.31',
];
print_r($temp);
natsort($temp);
print_r($temp);
↓
Array
(
[0] => 10.1.22
[1] => 10.2.1
[2] => 10.2.12
[3] => 10.3.32
[4] => 10.7.0
[5] => 5.5.31
)
Array
(
[5] => 5.5.31
[0] => 10.1.22
[1] => 10.2.1
[2] => 10.2.12
[3] => 10.3.32
[4] => 10.7.0
)
+ natsort()
- https://www.php.net/manual/en/function.natsort.php
- http://docs.php.net/manual/kr/function.natsort.php
+ natcasesort()
- https://www.php.net/manual/en/function.natcasesort.php
- http://docs.php.net/manual/kr/function.natcasesort.php
$temp = [
'10.1.22',
'10.2.1',
'10.2.12',
'10.3.32',
'10.7.0',
'5.5.31',
];
print_r($temp);
natsort($temp);
print_r($temp);
↓
Array
(
[0] => 10.1.22
[1] => 10.2.1
[2] => 10.2.12
[3] => 10.3.32
[4] => 10.7.0
[5] => 5.5.31
)
Array
(
[5] => 5.5.31
[0] => 10.1.22
[1] => 10.2.1
[2] => 10.2.12
[3] => 10.3.32
[4] => 10.7.0
)
게시글 목록
| 번호 | 제목 |
|---|---|
| 16019 | |
| 16015 | |
| 16014 |
jQuery
jQuery.holdReady( hold )
|
| 16013 |
jQuery
jQuery.hasData( element )
1
|
| 16011 | |
| 16010 | |
| 16009 |
jQuery
jQuery.globalEval (code)
|
| 16008 | |
| 16004 | |
| 16003 |
jQuery
jQuery.getJSON()
|
| 16002 |
jQuery
jQuery.get()
|
| 16001 |
jQuery
jQuery.fx.off
|
| 15993 |
jQuery
jQuery.fx.interval
|
| 15992 |
jQuery
jQuery.fn.extend ()
2
|
| 15991 |
jQuery
jQuery.extend()
|
| 15988 |
jQuery
jQuery.escapeSelector ()
|
| 15987 |
jQuery
jQuery.error (message)
|
| 15986 |
jQuery
jQuery.each()
|
| 15985 |
jQuery
jquery 가상 선택자 확장하기.
|
| 15981 |
jQuery
jQuery.dequeue()
|
| 15980 |
jQuery
jQuery.Deferred()
|
| 15979 |
jQuery
jQuery.data()
|
| 15978 |
jQuery
jQuery.cssNumber
|
| 15977 |
jQuery
jQuery.cssHooks
|
| 15976 | |
| 15975 |
jQuery
jQuery.Callbacks ()
|
| 15974 |
jQuery
jQuery.ajaxTransport ()
|
| 15973 |
jQuery
jQuery.ajaxPrefilter()
1
|
| 15971 |
jQuery
jQuery.ajaxPrefilter()
|
| 15970 |
jQuery
jQuery.ajax()
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기