示例:我希望sql只输出具有6位字符“AAAAAA”的行。我不希望行数超过该值。
答案 0 :(得分:0)
"SELECT * FROM table WHERE LENGTH(columnName) = 6" If MySql and
"SELECT * FROM table WHERE LEN(columnName) = 6" If MSSql
答案 1 :(得分:0)
SELECT * FROM table WHERE field REGEXP '^[A]{6}$';