SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to form a query for this?

    Hi all,
    I want to sort the table data based on the rank...
    If ranks are equal, for example there are ten records of same rank, i want these ten records are in alphabetic order.... and the remaining will populate as usual based on rank....

    Give me the query to implement it...

    Thanking you..

  2. #2
    Non-Member
    Join Date
    Dec 2010
    Location
    /home/pc
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by venkat6134 View Post

    Give me the query to implement it...
    Do you mean free of charge?

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For this you need provide the table structure, I assume the following structure:
    Code:
    id
    title
    rank
    So your query should look like this:
    Code mysql:
    SELECT t1.*
    FROM tblname AS t1
    ORDER BY t1.rank ASC, t1.title ASC;
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you rajug.
    It is working...


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
  •