Jump to content

Age based query


jaymc

Recommended Posts

I have a member database, and with that I have a members online list, heres the problem

 

If a member is over 18, I want to display members over 16 first, then when there are no more over 16's, show anyone else (14, 15 year olds etc)

 

So in other words there may be 23 pages of over 16's, then the 24th page will show 14 and 15 year olds

 

How can I make this into a query, as obvious "select * from members where age >= 16" will not show any under 16s on page 24..

 

Any ideas?

Link to comment
Share on other sites

lets say I have these ages

 

14,15,15,16,17,20,23,25,25,26,29,30

 

I want to display them something like this

 

23,17,30,16,26,25,25,20,15,14,15

 

In other words, any age under 16 can never come before an age 16 or over

 

I cant do a subquery because im not displaying all the results in one big list, they will be paginated

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.