Задавайте вопросы, мы ответим
Вы не зашли.
Добрый вечер! Есть вот такой запрос на выборку:
SELECT
plan.disciplina as dis1,
groups.naselenie as stud_count,
plan.chasi_full as fulltime,
plan.krediti as kared,
plan.lekcii as lek,
plan.praktiki as pr,
plan.labi as lb,
plan.chasi_selfwork as timeself,
plan.chasi_modul as timemodul,
plan.kontrol_type as KT,
kafedri.name_kaf as kafedra,
speci.specialnost as speciality,
forma_nav.fnav as formanav4,
ROUND(groups.naselenie*0.15*3) as chekmodKR,
groups.naselenie*0.5 as chekKR,
groups.naselenie*2 as ruk_kurs_work,
groups.naselenie*24 as ruk_dip_work,
"2" as za4et,
ROUND(groups.naselenie*0.33) as exzam,
groups.naselenie*2 as DEK,
(plan.lekcii + plan.praktiki + plan.labi + plan.chasi_selfwork + plan.chasi_modul + ROUND(groups.naselenie*0.15*3) + groups.naselenie*0.5 + groups.naselenie*2 + groups.naselenie*24 + 2 + ROUND(groups.naselenie*0.33) + groups.naselenie*2) as All1,
CEILING(plan.semestr / 2) as bob
FROM plan
Left Join kafedri ON kafedri.id_kaf = plan.id_kaf AND kafedri.id_kaf = plan.id_kaf
Left Join speci ON speci.id_spec = plan.id_spec Left Join forma_nav ON forma_nav.id_fnav = plan.id_form_nav
Left Join groups ON groups.id_spec = plan.id_spec and groups.god like "%2001%"
where plan.god like "%%" and (plan.semestr = "1" OR plan.semestr = "3" OR plan.semestr = "5" OR plan.semestr = "7" OR plan.semestr = "9" OR plan.semestr = "11") AND forma_nav.fnav like "%Дневная%"
ORDER BY plan.id_form_nav ASC, bob, plan.id)
как эту выборку записать в другую таблицу?
т.е. что-то типа INSERT INTO main (dis1, stud_count, fulltime, kared, lek, pr, lb, timeself, timemodul, KT, kafedra, speciality, formanav4, chekmodKR, chekKR, ruk_kurs_work, ruk_dip_work, za4et, exzam, DEK, All1, bob) values ... ?
Неактивен
INSERT INTO main (dis1, stud_count, fulltime, kared, lek, pr, lb, timeself, timemodul, KT, kafedra, speciality, formanav4, chekmodKR, chekKR, ruk_kurs_work, ruk_dip_work, za4et, exzam, DEK, All1, bob) SELECT ...[ваша выборка];
Неактивен