完整的语句如下,
SELECT * INTO NT1119 FROM (
select distinct quyu,sheng,hangyie,qta_bjmc,qta_mc ,count(*) [COUNT] from biyan002 group by quyu,sheng,hangyie,qta_bjmc,qta_mc
UNION
select distinct quyu,sheng,hangyie,qtb_bjmc,qtb_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,qtb_bjmc,qtb_mc
UNION
select distinct quyu,sheng,hangyie,qtc_bjmc,qtc_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,qtc_bjmc,qtc_mc
UNION
select distinct quyu,sheng,hangyie,qtd_bjmc,qtd_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,qtd_bjmc,qtd_mc
UNION
select distinct quyu,sheng,hangyie,qte_bjmc,qte_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,qte_bjmc,qte_mc
UNION
select distinct quyu,sheng,hangyie,qtf_bjmc,qtf_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,qtf_bjmc,qtf_mc
UNION
select distinct quyu,sheng,hangyie,ckj_gys,ckj_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,ckj_gys,ckj_mc
UNION
select distinct quyu,sheng,hangyie,t301a_gys,t301a_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,t301a_gys,t301a_mc
UNION
select distinct quyu,sheng,hangyie,zydy_gys,zydy_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,zydy_gys,zydy_mc
UNION
select distinct quyu,sheng,hangyie,pc_dy_gys,pc_dy_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,pc_dy_gys,pc_dy_mc
UNION
select distinct quyu,sheng,hangyie,nc_gys,nc_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,nc_gys,nc_mc
UNION
select distinct quyu,sheng,hangyie,yp_gys,yp_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,yp_gys,yp_mc
UNION
select distinct quyu,sheng,hangyie,zb_gys,zb_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,zb_gys,zb_mc
UNION
select distinct quyu,sheng,hangyie,cpu_gys,cpu_mc ,count(*) from biyan002 group by quyu,sheng,hangyie,cpu_gys,cpu_mc)
执行后,得到的提示如下:
消息 102,级别 15,状态 1,第 28 行
')' 附近有语法错误。
不太明白,( )是一对一了,哪里的语法错了?