Sep 05, 2007 16:56
На работе завал)) Развлекаюсь вещами типа
///10 раз все проверить, адресацию КЛАДР дописать
////////////// Активные ГО. схема оборудования
//f46_tense tinyint Уровень напряжения для 46 формы.
//=[id_names].id, id_group = 10 000
//f46_mps tinyint 0 = не МПС, 1 = МПС
//tarif_tense tinyint Уровень напряжения для расчета тарифа
//=[id_names].id, id_group = 10 001
/// 75 AS Expr12, 2 AS Expr13, ob.UL_ID, CAST(ob.NDOMA AS varchar(4)) AS Expr16, 0 AS Expr14, CAST(ob.NKVART AS varchar(20)) AS Expr17, 1 AS Expr15
INSERT INTO power
(power_id, pay_id, cons_id, energy_id, live_in, live_out, power_name, alt_nazn_id, PlantCount, SupplyCategory, f46_tense, f46_mps, tarif_tense,
post_ind, rgn, village_id, street_id, house_nb, house_body, flat_nb, part_count)
SELECT DISTINCT
ob.POWID, dp.nom_par, 1 AS Expr1, 1 AS Expr2, CAST('1/1/2007' AS datetime) AS Expr3, CAST('1/1/2010' AS datetime) AS Expr4,
CAST(ob.NAME AS varchar(50)) AS Expr5, NULL AS Expr6, 1 AS Expr7, NULL AS Expr8,
tar_sup2, 0 AS Expr10, tar_sup ,
dp.indexo, 0 AS Expr12, citykod, ob.streetkod, 0 AS Expr16, ob.ndoma , CAST(ob.nKVART AS varchar(12)) AS Expr17, 1 AS Expr15
FROM obspis_full_d$ ob INNER JOIN
dognk_par dp ON ob.CODE = dp.code_dog
P.s надо сделать еще несколько последних рывков и впереди будет ..........
работа