Jump to content

[SOLVED] Skip characters in sort by?


Boo-urns

Recommended Posts

I was wondering what the method would be to skip certain characters in a sort by?

 

SELECT name FROM foods WHERE viewable='Y' ORDER BY name ASC

 

How would i skip it if the first character in the name column starts with a quote or numbers to skip to their first character?

 

Thanks for your help!

Corey

Link to comment
Share on other sites

Could you simply just do that query and then process the results for what you want? Or is it that your query will be astronomically large with the extra items?

 

Secondarily, if there is something unique about the entries that start with a quote or numbers, you could add an extra column to the table like 'type' and then make your WHERE class also check this 'type' category for a match as well as your viewable='Y'.

Link to comment
Share on other sites

Hmmm... The first option might work bascially what I will be doing with the data being presented is to paginate all of them and there are over 2000 rows so I don't know how quick that would be.  I wasn't sure if there was a mysql function or term that I could use that I was unaware of.

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.