Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts

    sort record according to specifc condition

    Hi

    i selected all data from mysql database, however i want to do some special functions like sort according to customer name ( all records with same customer group together) etc

    how can i do that? i have checked use of group by, but it is not right, it only shows one record of each customer, not all records of the same customer, anyone helps? is it possible to write in one query?
    flying dagger

  • #2
    Banned
    Join Date
    Feb 2008
    Location
    Winnipeg, Canada
    Posts
    396
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try something like:

    PHP Code:
    SELECT FROM tblCustomers ORDER BY CustomerID 
    Or with a WHERE clause:

    PHP Code:
    SELECT FROM tblCustomers WHERE CustomerName='Bob' ORDER BY CustomerID 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •