GalookCZ

sql queries

Mar 21st, 2021
947
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2. ockovaci_mista.misto_id,
  3. ockovaci_mista.misto_nazev,
  4. ockovani.vekova_skupina,
  5.  
  6. COUNT(*) as total,
  7. COUNT(CASE WHEN ockovani.vakcina = "Comirnaty" THEN 1 ELSE null END) as pfizer,
  8. COUNT(CASE WHEN ockovani.vakcina = "Comirnaty" OR ockovani.vakcina = "COVID-19 Vaccine Moderna" THEN 1 ELSE null END) as mrna,
  9. COUNT(CASE WHEN ockovani.vakcina = "COVID-19 Vaccine Moderna" THEN 1 ELSE null END) as moderna,
  10. COUNT(CASE WHEN ockovani.vakcina = "COVID-19 Vaccine AstraZeneca" THEN 1 ELSE null END) as astrazeneca
  11.  
  12. FROM `ockovani`
  13. JOIN ockovaci_mista ON ockovaci_mista.nrpzs_kod = ockovani.misto_kod
  14. WHERE ockovani.datum > (SELECT MAX(datum) from ockovani) - INTERVAL 8 DAY
  15. GROUP BY ockovaci_mista.misto_id, ockovaci_mista.misto_nazev, ockovani.vekova_skupina
  16.  
  17.  
  18.  
  19.  
  20. SELECT
  21.  
  22. misto_id,
  23. misto_nazev,
  24. vekova_skupina,
  25. povolani,
  26. rezervace,
  27. AVG(datum_rezervace - datum) as average_wait_time,
  28. COUNT(*) as total
  29.  
  30.  
  31. FROM `registrace`
  32. WHERE datum > ((SELECT MAX(datum) FROM registrace) - INTERVAL 8 DAY)
  33. GROUP BY misto_id, misto_nazev, vekova_skupina, povolani, rezervace
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×