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

Tags: ,

Sponsored Links



order by multiple

Software Development


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 30-06-2009
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
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 30-06-2009
opaper's Avatar
Member
 
Join Date: May 2008
Posts: 2,362
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


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 07:31 PM
multiple Domains under one domain or multiple forests under oneforest Rush Active Directory 7 24-11-2009 11:57 AM
Multiple inboxes for multiple accounts bmccaul Windows Vista Mail 4 20-09-2009 03:14 AM
How to change binding order to add multiple IP addresses on Windows Server 2003 Hajra Networking & Security 3 28-07-2009 08:55 PM
How to copy multiple files to multiple destination at a time Aaryn Windows Software 3 14-05-2009 11:25 AM


All times are GMT +5.5. The time now is 04:00 AM.