表名test
字段1 字段3
id name
1 浙AA0141041
2 浙AB1003002
3 浙AB0301002
^^^^^^^^^^^^^^^^^^^^^备注:'浙AB0301002'第3位即字符'A'求查询 满足条件下name字段中:(第3位='A') or(第3位!=B and length(name)=<10)最好不要用游标进行遍历~~!
字段1 字段3
id name
1 浙AA0141041
2 浙AB1003002
3 浙AB0301002
^^^^^^^^^^^^^^^^^^^^^备注:'浙AB0301002'第3位即字符'A'求查询 满足条件下name字段中:(第3位='A') or(第3位!=B and length(name)=<10)最好不要用游标进行遍历~~!
from test t
where
(Instr(name, 'A', 3)=3)
or (Instr(name, 'B', 3)<>3 AND length(name)=<10)