나는 count (ProductQuantity)를리스트에 저장했다. 각 ProductID가 다른 개수 (ProductQuantity)를 갖기 때문에 Count (ProductQuanity)를 기준으로 ProductID를 검색하려고합니다.where count sql statement
For Each i In sumofpquantity()
Dim sq As String = "SELECT ProductID From OrderDetail Where COUNT(ProductQuantity)= " & i & ""
Dim cmd2 As SqlCommand = New SqlCommand(sq, connection12)
Dim reading As SqlDataReader = cmd2.ExecuteReader()
While reading.Read()
list.Add(reading.GetInt32(reading.GetOrdinal("ProductID")))
End While
reading.Close()
Next i
sumofpquantity()는 수 (ProductQuanity) 개수에 따라 제품 ID (ProductQuantity)