tags:

views:

75

answers:

2

Hi All,

I want to find the data from table artists where name is start with letter a, b, c.

1.e. My o/p should contain Adam Alan Bob Ben Chris Cameron

But not GlAin, doC, dolBie

Regards,

Salil Gaikwad

+2  A: 

Try this:

select * from artists where name like "A%" or name like "B%" or name like "C%"
Dumb Guy
OR name LIKE "B%" etc...
David M
whoops, fixed it. thanks for the quick catch
Dumb Guy
No problem. Question title and body not 100% in agreement.
David M
A: 

You can use like 'A%' expression, but if you want this query to run fast for large tables I'd recommend you to put number of first button into separate field with tiny int type.

Dienow