Access SQL查询以基于空值和字母进行排序
我有一张像这样的桌子Access SQL查询以基于空值和字母进行排序,sql,ms-access,Sql,Ms Access,我有一张像这样的桌子 Ktype EID Basecode ------ ---- --------- sd 1001 S23 u M11 a 1003 R11 s 1004 M007 f
Ktype EID Basecode
------ ---- ---------
sd 1001 S23
u M11
a 1003 R11
s 1004 M007
f M7
k 1006 W546
w 1005 N77
x A40
b 1006 W546
如何获取Ktype,其中EID为空且Basecode不以M开头。试试这个
select ktype From [table] where eid is null and basecode not LIKE 'M%'
从[table]中选择ktype,其中eid为null,并且基码与'M%'不同
筛选条款需要是:
where EID is null
and left(Basecode, 1) <> 'M'
其中EID为空
左(基本代码,1)“M”