Results 1 to 3 of 3

Thread: order by multiple

  1. #1
    Join Date
    Mar 2009
    Posts
    30

    order by multiple

    I want to order multiple columns, with such away that it gives me the last name first & then the name & then shows the state. as shown in the following example :

    Code:
    Output :
    Mehta Abrahim, Gujarat
    Sumra Atique, Maharashtra
    Shah Kevin, Maharashtra
    Gada Kushal, Gujarat

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: order by multiple

    To get the output you require to use the following PHP Syntax

    Code:
    $query = "select * from table order by field2,field3,field4";

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: order by multiple

    You are the implementation of following SQL-instructie on the aforesaid table.

    Code:
    SELECT * FROM `lastname` ORDER BY name ASC , state DESC

Similar Threads

  1. Replies: 6
    Last Post: 09-10-2011, 06:31 PM
  2. Pre order for Serious Sam 3
    By Maee in forum Video Games
    Replies: 5
    Last Post: 10-08-2011, 05:51 AM
  3. Replies: 6
    Last Post: 01-10-2010, 06:26 AM
  4. Replies: 3
    Last Post: 28-07-2009, 07:55 PM
  5. Replies: 3
    Last Post: 14-05-2009, 10:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,574,667.53097 seconds with 17 queries