Jump to content

[SOLVED] Help with LIKE...


Switch0r

Recommended Posts

Im trying to retrieve a set of records by their starting character, some of which begin with numbers. I have no problem getting the lettered items out, just the numbers. What i want to have is a list that gives everything starting 0-9, then letters from a-z.

 

Firstly is there any query that will search for an array of LIKE values? id. LIKE '0-9%'? Or am I going to have to run a while loop on the query for each number separately? (Which I also have no problem doing, it just seems rather an inelegant way of doing things...

 

Thanks for any help :)

Link to comment
Share on other sites

right, I figured it out...I feel sheepish :)

 

I was trying to use LIKE multiple times which wasnt working, as i wasnt telling it what it should be like each time.

 

ie where title like '1%' or '2%' etc... - wrong!

 

where title like '1%' or title like '2%' etc... - works like a charm :)

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.