mysql 排序

WBOY
Release: 2016-06-13 10:26:13
Original
685 people have browsed it

mysql 排序求助

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->比如sql ="SELECT * FROM A WHERE `id` IN (5,18,25,4)"
Copy after login

现在的问题是怎么才能实现排序按照in数组(5,18,25,4)里的顺序来排序结果集?


------解决方案--------------------
... order by find_in_set(id, '5,18,25,4')
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!