Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Select R.idR, R.,NazwaRozgrywek, Count(Distinct Z.idZ)/Count(Distinct M.idM) as iloscZdarzen,
  2. ( Select count(Distinct TZ.idTZ)/Count(Distinct M.idM) as IloscBramek
  3. FROM Rozgrywka as R left join SezonRozgrywek as SR ON R.idR = SR.idR
  4. left join Klub as K ON SR.idK = K.idK
  5. left join Mecz as M ON M.idK = K.idK AND K.idK = M.idK2
  6. left join Zdarzenie as Z ON M.idM = Z.idM
  7. left join TypZdarzenia as TZ ON TZ.idTz = Z.idTZ
  8. Group by M.idM
  9. Having Tz.nazwaTz = 'Gol gosp') golGosp
  10.  
  11. ( Select count(Distinct TZ.idTZ)/Count(Distinct M.idM) as IloscBramek
  12. FROM Rozgrywka as R left join SezonRozgrywek as SR ON R.idR = SR.idR
  13. left join Klub as K ON SR.idK = K.idK
  14. left join Mecz as M ON M.idK = K.idK AND K.idK = M.idK2
  15. left join Zdarzenie as Z ON M.idM = Z.idM
  16. left join TypZdarzenia as TZ ON TZ.idTz = Z.idTZ
  17. Group by M.idM
  18. Having Tz.nazwaTz = 'Gol gosc') golGosc
  19.  
  20.  
  21. FROM Rozgrywka as R left join SezonRozgrywek as SR ON R.idR = SR.idR
  22. left join Klub as K ON SR.idK = K.idK
  23. left join Mecz as M ON M.idK = K.idK AND K.idK = M.idK2
  24. left join Zdarzenie as Z ON M.idM = Z.idM
  25. left join TypZdarzenia as TZ ON TZ.idTz = Z.idTZ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement