About 508,000 results
Open links in new tab
  1. How to define a custom ORDER BY order in mySQL

    Feb 21, 2012 · In MySQL how do I define a custom sorting order. To try to explain what I want consider this table: ID Language Text 0 ENU a 0 JPN b 0 DAN c 1 ENU ...

  2. sql - Natural Sort in MySQL - Stack Overflow

    Sep 30, 2008 · 15 MySQL doesn't allow this sort of "natural sorting", so it looks like the best way to get what you're after is to split your data set up as you've described above (separate id field, …

  3. Order a MySQL table by two columns - Stack Overflow

    How do I sort a MySQL table by two columns? What I want are articles sorted by highest ratings first, then most recent date. As an example, this would be a sample output (left # is the rating, …

  4. sql - Using union and order by clause in mysql - Stack Overflow

    In MySQL if you use parenthesis then scope of query is limited to parenthesis, if you want to sort the UNION result data coming from two or more complex queries use all SELECT and UNION …

  5. How does ORDER BY FIELD () in MySQL work internally

    When MySQL cannot use index to retrieve data in sorted order, it creates a temporary table/resultset with all selected columns and some additional data - one of those is some kind …

  6. How to sort a MYSQL table in a permanent way? - Stack Overflow

    How to sort a MYSQL table in a permanent way? Asked 11 years, 11 months ago Modified 1 year, 6 months ago Viewed 45k times

  7. mysql - SQL order string as number - Stack Overflow

    Mar 10, 2017 · I have numbers saved as VARCHAR to a MySQL database. I can not make them INT due to some other depending circumstances. It is taking them as character not as number …

  8. Make nulls come last when sorting ascending - Stack Overflow

    I have a SQL table with a datetime field that can be null. What is a simple way to sort query results ascending by datetime, but with rows where datetime is null at the end, not at the …

  9. Sorting multiple fields in MySQL - Stack Overflow

    I have a table with 2 fields DATE and IMPORTANCE. Now I want to sort both these fields in DESCENDING ORDER so that the rows are ordered by IMPORTANCE for EACH DATE. For …

  10. mysql - Ordering by specific field value first - Stack Overflow

    select * from your_table order by name <> 'core', priority Since the result of a comparision in MySQL is either 0 or 1 and you can sort by that result.