MYSQL | ORDER by 정렬(임의적인 순번) | |||||
---|---|---|---|---|---|
작성자 | 작성일 | 18-03-08 15:16 | |||
특정 테이블의 필드 "field" 에 값이 "A","B","C","D"와 같이 들어가있는 경우 "A","C","D","B"와 같이 정렬 하기 위한때.. SELECT * FROM table WHERE ........ ORDER by case when (type = 'A') then 1 when (type = 'C') then 2 when (type = 'D') then 3 when (type = 'B') then 4 end, another_field DESC |
|||||
|
댓글목록
등록된 댓글이 없습니다.