select 项目,数量 from (select 项目='总户数',数量=总户数 from 社区居委会资料 union all select 项目='户籍户数',数量=户籍户数 from 社区居委会资料 union all select 项目='户籍人口',数量=户籍人口 from 社区居委会资料 union all select 项目='常住人口',数量=常住人口 from 社区居委会资料 union all select 项目='户在人在数',数量=户在人在数 from 社区居委会资料 union all select 项目='户在人不在数',数量=户在人不在数 from 社区居委会资料 union all select 项目='人在户不在数',数量=人在户不在数 from 社区居委会资料 union all select 项目='流动人口',数量=流动人口 from 社区居委会资料) t
以上sql语句在sql查询分析器中可以执行,但是用到access中的时候就会提示“至少有一个参数未指定”的错误,请各位帮忙看看需要怎样修改。
下面的图片是原数据以及所要实现的结果数据格式。
就是下面这个图片