Connecting Tech Pros Worldwide Forums | Help | Site Map

SQL Scripts "LIKE" Statement? need help

Newbie
 
Join Date: Dec 2006
Posts: 1
#1: Dec 6 '06
hi,

Good day!

Anyone generous enough to help me with this query. Anyway,

I have a random acount number of 1, 2, 3, 4, 5 and i wanna get the results after this number in a table.

Select * from table where account like ('1%','2%', '3%','4%','5%')


is this select query possible or not? or there are other method which you can recommend. thank you.

regards,

Unamas

ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Dec 6 '06

re: SQL Scripts "LIKE" Statement? need help


No, this format is not possible. But I would prefer the following:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table where SUBSTRING(account,1,1) BETWEEN 1 AND 5
Ronald :cool:
Reply


Similar MySQL Database bytes