scarab890
asked on
select first alphabet from title
Hello,
i have a field called "title" in my table, can you tell me the sql statement to select the row if the first alphabet of the title is "a"?
for example here are 3 rows:
jack is a good boy
jill is sillu
abby is naughty
kevin is lazy
If i do a search on "j" then both jack and jill should come back as results...
and lastly, how to do this if the first character is a number from 0-9?
Thanks!
i have a field called "title" in my table, can you tell me the sql statement to select the row if the first alphabet of the title is "a"?
for example here are 3 rows:
jack is a good boy
jill is sillu
abby is naughty
kevin is lazy
If i do a search on "j" then both jack and jill should come back as results...
and lastly, how to do this if the first character is a number from 0-9?
Thanks!
SELECT * FROM Table WHERE SUBSTRING(title,1,1)='a'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This was the most important to me:
select * from mytable where title >= '0' and title <='9'
thanks!
select * from mytable where title >= '0' and title <='9'
thanks!
select * from mytable where title like 'j%'
select * from mytable where title like '0%'