Jump to content

Having issues with my Order By


Jim R
Go to solution Solved by Jim R,

Recommended Posts

Here is the query:

$query = 'SELECT * FROM a_playerRank WHERE year="2015" and position="1" and grouping<4 ORDER BY grouping DESC,rankPos,region,nameLast';

I have three groups (grouping).  

The first group is based on their ranking 1-10 or 1-15.  (working fine)

The second group is supposed to be alphabetical based on last name.  (not working)

The third group is supposed to be based on region, then alphabetically by their last name, and I have a header for each region. (working fine)

 

I attached an image of grouping two and three.  Group two (top group in the picture) isn't alphabetical.  

 

I know why the query isn't producing what I want, but I can't figure out the query I need to get my list to show as I described it.  It shows the second group ordered by region then last name, just without headers.  When I flip region and nameLast in the order by, the second group works great, but the third group basically produces a header for each kid (it looks like a mess).

 

I assume there is a more complex query that will produce what I want.  

 

 

post-44159-0-82094100-1399601302_thumb.png

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.