PDA

View Full Version : selected a field that starts with...


Phip
10-13-2002, 10:19 PM
i need this but in a sql format:

SELECT theField FROM tableName WHERE theField starts with the letter A

thanks

BigDaddy
10-13-2002, 11:41 PM
http://www.w3schools.com/sql/sql_where.asp


SELECT theField FROM tableName WHERE theField like 'A%'

Phip
10-15-2002, 12:27 AM
What if i wanted to select a group like anything that starts with 0 to 9

whammy
10-15-2002, 12:43 AM
select * from scripts where title like '1%' OR title like '2%' OR title like '3%' etc.

Assuming that it's not a numeric value... you can do that like:

select * from scripts where cid > 1

Phip
10-16-2002, 06:01 PM
That answer is so obvious... I can't believe I didn't think of that. :rolleyes: