select distinct a.art_no,batch_no,b.technics_no
from dbo.PdArtRecipeMain a with(nolock) join PdArtRecipeDetail b with(nolock) on a.art_no=b.art_no
where a.art_no='N077120024'在加上distinct 得到的technics_no排序不一样,但是不加distinct 会有很多重复的信息,
请问高手们怎么处理?TKS!
from dbo.PdArtRecipeMain a with(nolock) join PdArtRecipeDetail b with(nolock) on a.art_no=b.art_no
where a.art_no='N077120024'在加上distinct 得到的technics_no排序不一样,但是不加distinct 会有很多重复的信息,
请问高手们怎么处理?TKS!
from dbo.PdArtRecipeMain a with(nolock) join PdArtRecipeDetail b with(nolock) on a.art_no=b.art_no
where a.art_no='N077120024'
order by a.art_no --自己排序
正常顺序是
111#
111#
40#
40#
131#
131#
131#
210#
210#
但是加DISTINCT 后就变成了
111#
131#
210#
40#
请高手们继续指点!TKS!
from dbo.PdArtRecipeMain a with(nolock) join PdArtRecipeDetail b with(nolock) on a.art_no=b.art_no
where a.art_no='N077120024'
select distinct a.art_no,batch_no,b.technics_no
from #
order by iddrop table #
111#
40#
131#
210#,
不知怎么处理?