查询技巧共享
1.要显示customerid的第一位为A到M,后面任意的记录
SELECT * from orders where customerid LIKE ‘[A-M]%’
2.也可以改为这样(表示最后一位为A到M,前面任意)
SELECT * from orders where customerid LIKE ‘%[A-M]’
3.如要固定开头或中间或结尾也可以像下面这样
SELECT * from orders where customerid LIKE ‘[A]%’
SELECT * from orders where customerid LIKE ‘[ABC]%’
SELECT * from orders where customerid LIKE ‘%[A-M]%’
SELECT * from orders where customerid LIKE ‘%[A-DH]’
多谢捧场...