Changes between Version 3 and Version 4 of AdvancedReports


Ignore:
Timestamp:
01/24/24 16:13:27 (12 months ago)
Author:
175012
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v3 v4  
    3232ORDER BY
    3333    usage_count DESC;
     34
     35}}}
     36
     37=== Преференца на клиентот за број на денови според неговите објави за Travel Health полиса за минатата година во опаѓачки редослед ===
     38
     39{{{#!sql
     40
     41select
     42        'Travel Health' as Typepolicy,
     43    COUNT(*) AS posts_count,
     44    (p.edate::DATE - p.sdate::DATE) AS average_days_preference
     45FROM
     46    project."policy" as p
     47JOIN
     48    project.Pol_travel AS Pt ON p.p_id  = Pt.pol_id
     49WHERE
     50    EXTRACT(YEAR FROM p.edate) = EXTRACT(YEAR FROM CURRENT_DATE) - 1
     51GROUP BY
     52   average_days_preference
     53order by average_days_preference desc
    3454
    3555}}}