的SQL LIKE子句用来比较的值使用通配符运营商类似的值。有两个通配符与LIKE运算符一起使用:
The percent sign (%)
The underscore (_)
百分号表示零个,一个或多个字符。下划线表示单个数字或字符。这些符号可以组合使用。
WHERE SALARY LIKE '%200%'
发现,在任何位置
所以要根据您的病情,需要一定的变量,它包含要进行选择,然后把语句像这个月有200的任何值,
WHERE SALARYDATE LIKE '%mar%'
你
或 一些其他的选择
WHERE SALARY LIKE '200%' Finds any values that start with 200
WHERE SALARY LIKE '%200%' Finds any values that have 200 in any position
WHERE SALARY LIKE '_00%' Finds any values that have 00 in the second and third positions
WHERE SALARY LIKE '2_%_%' Finds any values that start with 2 and are at least 3 characters in length
WHERE SALARY LIKE '%2' Finds any values that end with 2
WHERE SALARY LIKE '_2%3' Finds any values that have a 2 in the second position and end with a 3
WHERE SALARY LIKE '2___3' Finds any values in a five-digit number that start with 2 and end with 3
什么是您的付款日期的类型,是字符串还是日期时间? – wizzardz 2013-03-25 05:23:17