With an oracle unfamiliar, just starting to learn. Here is the query that selects subscribers and bases
SELECT DISTINCT ss_login, ct_mcode, ct_id FROM inac.start_stop, inac.services, inac.cities0, inac.services_param WHERE inac.services.s_f_vpdn = 1 AND inac.services.s_f_ppp = 0 AND inac.start_stop.ss_service = inac.services.s_id AND inac.services.s_city = inac.cities0.ct_id AND ct_mcode = 'RND' AND ss_start <= to_date('01.11.2016', 'DD/MM/YYYY') AND (ss_stop >= to_date('01.10.2016', 'DD/MM/YYYY') or ss_stop is null) it is necessary that information about whether the subscriber is convergent or not has got into the sample
connection of inac.start_stop.ss_service = inac.services_param.id_service condition that the subscriber is convergent inac.services_param.param_name = 'BILL_TYPE' and inac.services_param.param_number = 3
I tried it like this
SELECT DISTINCT ss_login, ct_mcode, ct_id, param_name, param_number CASE WHEN param_name = 'BILL_TYPE' and param_number = 3 THEN 'Да' ELSE 'Нет' end FROM inac.start_stop, inac.services, inac.cities0, inac.services_param WHERE inac.services.s_f_vpdn = 1 AND inac.services.s_f_ppp = 0 AND inac.start_stop.ss_service = inac.services.s_id AND inac.services.s_city = inac.cities0.ct_id AND inac.start_stop.ss_service = inac.services_param.id_service AND ct_mcode = 'RND' AND ss_start <= to_date('01.11.2016', 'DD/MM/YYYY') AND (ss_stop >= to_date('01.10.2016', 'DD/MM/YYYY') or ss_stop is null) Error ERROR at line 3: ORA-00923: FROM keyword not found where expected
join. With them where more readable requests are obtained, IMHO. - 4per