Dim cmd As New SQLCommand
Dim ld As DataTable
cmd.C
cmd.CommandText = "select Distinct 物料编号 From {销售单} "
ld = cmd.ExecuteReader()
Dim lst As List(of String) = ld.GetValues("物料编号")
dim sql as string = “select Distinct 物料编号 From {销售表} where 物料编号 in ('" & String.Join("','",l st.ToArray) & "')”