Select some data using ‘IN’ clause, the result should keep the same order as the in conditions.
SELECT SECCODE, SECSNAME FROM SECURITY
WHERE SECCODE IN
('1U68',
'1F77')
ORDER BY
CharIndex(LTRIM(RTRIM([SECCODE])), '1U68, 1F77')
In MySQL, you can use “Order By Field()
http://www.electrictoolbox.com/mysql-order-specific-field-values/
Using Oracle Auto-Increment/Sequence in Hibernate/MyBatis <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.