Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- P.Naziv [Naziv proizvoda],
- SUM(S.Kolicina) [Prodana količina]
- FROM Proizvod P
- INNER JOIN Stavka S
- ON S.ProizvodID = P.IDProizvod
- INNER JOIN Racun R
- ON R.IDRacun = S.RacunID
- INNER JOIN Kupac K
- ON K.IDKupac = R.KupacID
- INNER JOIN Grad G
- ON G.IDGrad = K.GradID
- INNER JOIN Drzava D
- ON D.IDDrzava = G.IDGrad
- WHERE
- D.Naziv = 'Hrvatska'
- AND
- (
- K.Telefon LIKE '1%'
- OR
- K.Telefon LIKE '3%'
- OR
- K.Telefon LIKE '5%'
- )
- GROUP BY P.Naziv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement