Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Access SQL查询以基于空值和字母进行排序_Sql_Ms Access - Fatal编程技术网

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”