Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. --zamowienie klienta o najmniejszej ilosci produktow
  2. select TOP 1 @idzamowienia= od.OrderID from Orders o
  3. join [Order Details] od on od.OrderID=o.OrderID
  4. where o.CustomerID=@idklienta
  5. group by od.OrderID
  6. order by COUNT(*) asc
  7.  
  8. A nie powinno być order by SUM(od.Quantity) asc?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement