SQL query ?
Community Forums/General Help/SQL query ?
| ||
Anyone know how to set a sql query to allow only entries in alphabetic ranges, i.e. entries starting with the letters a-h only? I assume I'll need to use LIKE somehow but don't know what query string will achive this. Thanks Basil |
| ||
select * from file where entry >= "a0000" and entry <= "h0000" |
| ||
SELECT * FROM table WHERE name BETWEEN "a%" AND "hz%" If you were to instead use: SELECT * FROM table WHERE name BETWEEN "a%" AND "h%"...then no results beginning with H would be returned. |
| ||
Thanks for the help. I worked it out in the end using WHERE name LIKE '[a-h]%'; Cheers Basil |