Share
Showing posts with label ORDER BY. Show all posts
Showing posts with label ORDER BY. Show all posts
  • If you have more tables in your database those who are holding columns of same name then you can sort out the specified column and its data form a table by this command-
    SELECT customers.address FROM customers
  • If you want sort your result in alphabetic order or numeric order then command-
    SELECT name FROM customers ORDER BY name
    SELECT name, address FROM customers ORDER BY id
  • If you want to sort multiple columns then the command should be like this-
    SELECT name, state, address FROM customers ORDER BY state, name