查询会龄 sql部分-LMLPHP

  AND (
      case when ${fld:vc_age} = '1' then ((current_date-d.c_idate::date)/30)<3
      when ${fld:vc_age} = '2' then ((current_date-d.c_idate::date)/30)>=3 and ((current_date-d.c_idate::date)/30)<=6
      when ${fld:vc_age} = '3' then ((current_date-d.c_idate::date)/30)>6 and ((current_date-d.c_idate::date)/30)<=12
      when ${fld:vc_age} = '4' then ((current_date-d.c_idate::date)/30)>12 and ((current_date-d.c_idate::date)/30)<=36
      when ${fld:vc_age} = '4' then ((current_date-d.c_idate::date)/30)>36
      else true end

05-07 09:38