issue #0001280 : Traitement des valeurs d'avisCs

This commit is contained in:
Michael RICOIS 2012-07-24 07:50:20 +00:00
parent eb735dd8b0
commit 15b729dc1a

View File

@ -25,7 +25,7 @@ source ciblage
IF(teff_etab IS NULL,99,teff_etab), \
IF(web='',0,1) AS web, \
IF(mail='',0,1) AS mail, \
IF(adrDom='',0,1) AS adrDom, \
IF(adrDom>0,1,0) AS adrDom, \
actifEco, \
presentRcs, \
procolHisto, \
@ -68,9 +68,13 @@ source ciblage
CASE zru WHEN '' THEN 0 WHEN 'NSP' THEN 0 ELSE 1 END as zru, \
CASE cucs WHEN '' THEN 0 WHEN 'NSP' THEN 0 ELSE 1 END as cucs, \
IF(zrr=1,1,0) as zrr, \
IF(zafr=1,1,0) as zafr \
IF(zafr=1,1,0) as zafr, \
CASE avisCs WHEN 0 THEN 1 WHEN 10 THEN 2 WHEN 15 THEN 3 WHEN 23 THEN 4 WHEN 29 THEN 4 WHEN 39 THEN 4 WHEN 43 THEN 4 WHEN 21 THEN 5 WHEN 26 THEN 5 WHEN 28 THEN 5 WHEN 31 THEN 6 WHEN 50 THEN 6 WHEN 24 THEN 7 ELSE 0 END as avisCs \
FROM etablissements_act WHERE siren>100;
SELECT CASE avisCs WHEN 0 THEN 1 WHEN 10 THEN 2 WHEN 15 THEN 3 WHEN 23 THEN 4 WHEN 29 THEN 4 WHEN 39 THEN 4 WHEN 43 THEN 4 WHEN 21 THEN 5 WHEN 26 THEN 5 WHEN 28 THEN 5 WHEN 31 THEN 6 WHEN 50 THEN 6 WHEN 24 THEN 7 ELSE 0 END as avisCs FROM etablissements_act WHERE id=23514139
5907540
sql_field_string = siren
sql_field_string = nic
sql_attr_uint = siege