Forum Moderators: open

Message Too Old, No Replies

MYSQL first char range

         

davidmj

8:47 am on Aug 30, 2006 (gmt 0)

10+ Year Member



I am doing a count on a table but one of the conditions is like...

WHERE field between 'a%' and 'f%'

this is psudo code. What would be the correct syntax

coopster

3:42 pm on Aug 30, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, davidmj.

You could use a substring perhaps ...

WHERE SUBSTRING(columnName FROM 1 FOR 1) BETWEEN 'a' AND 'f';