Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* MERGE 1 */
- CREATE TABLE vr
- SELECT
- vr_h.misto_id,
- vr_h.misto_nazev,
- vr_h.vekova_skupina,
- vr_h.povolani,
- vr_h.total as h_total,
- vr_h.pocet_registrace as h_pocet_registrace,
- vr_h.pocet_rezervace as h_pocet_rezervace,
- vr_h.pomer_rezervace_total as h_pomer_registrace,
- vr_h.average_wait_time as h_wait_time,
- vr_w.total as w_total,
- vr_w.pocet_registrace as w_pocet_registrace,
- vr_w.pocet_rezervace as w_pocet_rezervace,
- vr_w.pomer_rezervace_total as w_pomer_registrace,
- vr_w.average_wait_time as w_wait_time
- FROM `vr_h`
- JOIN vr_w ON vr_w.misto_id = vr_h.misto_id AND vr_h.vekova_skupina = vr_w.vekova_skupina AND vr_w.povolani = vr_h.povolani
- /*MERGE 2*/
- CREATE TABLE vo
- SELECT
- vo_h.misto_id,
- vo_h.misto_nazev,
- vo_h.vekova_skupina,
- vo_h.total as h_total,
- vo_h.pfizer as h_pfizer,
- vo_h.moderna as h_moderna,
- vo_h.mrna as h_mrna,
- vo_h.astrazeneca as h_astrazeneca,
- vo_h.astrazeneca / vo_h.total as h_pomer_astrazeneca,
- vo_w.total as w_total,
- vo_w.pfizer as w_pfizer,
- vo_w.moderna as w_moderna,
- vo_w.mrna as w_mrna,
- vo_w.astrazeneca as w_astrazeneca,
- vo_w.astrazeneca / vo_w.total as w_pomer_astrazeneca
- FROM `vo_h`
- JOIN vo_w ON vo_w.misto_id = vo_h.misto_id AND vo_h.vekova_skupina = vo_w.vekova_skupina
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement