Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 29-06-2009
Member
 
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
Reply With Quote
  #2  
Old 29-06-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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";
Reply With Quote
  #3  
Old 29-06-2009
Member
 
Join Date: May 2008
Posts: 2,383
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "order by multiple"
Thread Thread Starter Forum Replies Last Post
Pre - order with delivery or pre order with stand in line for iPhone 4S? Skyla Portable Devices 6 09-10-2011 06:31 PM
Pre order for Serious Sam 3 Maee Video Games 5 10-08-2011 05:51 AM
How to Implement multiple iSCSI SAN deployment with iSCSI switch for multiple ESXi pATROCLUS Networking & Security 6 01-10-2010 06:26 AM
How to change binding order to add multiple IP addresses on Windows Server 2003 Hajra Networking & Security 3 28-07-2009 07:55 PM
How to copy multiple files to multiple destination at a time Aaryn Windows Software 3 14-05-2009 10:25 AM


All times are GMT +5.5. The time now is 08:48 AM.