select from w01 where gb016 in('10','30','40') and gb022 is not null and gb023 is not nullselect rtrim(hgb103) as 单位地址,gb001 as 姓名,gb016 as 婚姻状况,gs943 as 婚变日期,gb022 as 配偶姓名,gb023 as 配偶身份证号 from w01 wher

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/21 22:36:16
selectfromw01wheregb016in(''10'',''30'',''40'')andgb022isnotnullandgb023isnotnullselectrtrim(hgb103)as单位地址

select from w01 where gb016 in('10','30','40') and gb022 is not null and gb023 is not nullselect rtrim(hgb103) as 单位地址,gb001 as 姓名,gb016 as 婚姻状况,gs943 as 婚变日期,gb022 as 配偶姓名,gb023 as 配偶身份证号 from w01 wher
select from w01 where gb016 in('10','30','40') and gb022 is not null and gb023 is not null
select rtrim(hgb103) as 单位地址,gb001 as 姓名,gb016 as 婚姻状况,gs943 as 婚变日期,gb022 as 配偶姓名,gb023 as 配偶身份证号 from w01 where gb016 in('10','30','40') and gb022 is not null and gb023 is not null
为什么出来的结果里gb012和gb023为空的还是可以显示出来,望大侠们指教

结果里面为什么后两项为空的还是显示出来了

select from w01 where gb016 in('10','30','40') and gb022 is not null and gb023 is not nullselect rtrim(hgb103) as 单位地址,gb001 as 姓名,gb016 as 婚姻状况,gs943 as 婚变日期,gb022 as 配偶姓名,gb023 as 配偶身份证号 from w01 wher
select 
  rtrim(hgb103) as 单位地址, 
  gb001 as 姓名,
  gb016 as 婚姻状况,
  gs943 as 婚变日期,
  gb022 as 配偶姓名,
  gb023 as 配偶身份证号 
from 
  w01 
where 
  gb016 in('10','30','40') 
  and gb022 is not null 
  and rtrim(gb022) != ''
  and gb023 is  not null
  and rtrim(gb023) != ''