0

i need to sort the number from ascending value. sample data is

463919493       
463919493 02
463919493 02
463919493 03
463919493 01
463919493 03
463919493 01

i need to get output as

463919493       
463919493 01
463919493 01
463919493 02
463919493 02
463919493 03
463919493 03

and suppose if we have alphabet with number, how to sort this number in asscending

  HO463919493       
  HO463919493 02
  HO463919493 02
  HO463919493 03
  HO463919493 01
  HO463919493 03
  HO463919493 01

Need to get output as:

 HO463919493       
 HO463919493 01
 HO463919493 01
 HO463919493 02
 HO463919493 02
 HO463919493 03
 HO463919493 03
  • 1
    Is that 1 column or 2? The table definition and your query would go far here. Also the SQL version/dbms as well. – Jacob H Apr 26 '18 at 12:41
  • 1
    Your question is very unclear. Is that one column or two? What database are you using? What happens if the first "column" has different values? – Gordon Linoff Apr 26 '18 at 12:43
  • Please post a query that you are having trouble with. –  Apr 26 '18 at 12:44
  • Possible duplicate of [SQL Query ORDER BY column values](https://stackoverflow.com/questions/6465712/sql-query-order-by-column-values) –  Apr 26 '18 at 12:44
  • 1
    Poor sample data, same value all over a column. – jarlh Apr 26 '18 at 12:44
  • check this answer https://stackoverflow.com/a/2060952/223752 – Nitin Sawant Apr 26 '18 at 12:56

1 Answers1

0

SYNTAX:

SELECT
    *
FROM
    table
ORDER BY
    col1 asc

For multiple column:

SELECT
    *
FROM
    table
ORDER BY
    col1 asc,
    col2 desc
Rahul Jain
  • 1,319
  • 7
  • 16