你的意思是说spxx表中有个barcode连接到spbarcode中,但是与spbarcode相对应的有两条数据相对应于barcode,你想把这两条数据整合成为一条?首先,你得把所有的数据整合起来,create temp table temp asselect *(你需要的字段) from spxx,spbarcode where codition;然后通过temp的自连接进行整合,自连接的条件是除了barcode的其他字段;...
select (除barcode外的所有字段) into #temp1from spxxselectbarcode, sp_ID into #temp2 from spbarcodeselect* from #temp1 a,#temp2 b where a.sp_ID=b.sp_ID order by sp_IDdrop table...