Changes between Version 4 and Version 5 of AdvancedReports


Ignore:
Timestamp:
12/27/22 14:41:36 (19 months ago)
Author:
201065
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v4 v5  
    8787
    8888}}}
     89
     90===  Извештај за категориите со најмногу продадаени артикли===
     91
     92{{{#!sql
     93select c.categoryname, a.articlename, coalesce(sum(i.quantity),0) as vkol from articles a
     94        left join article_belongs_to_category abtc on abtc.articleid=a.articleid
     95        left join categories c on c.categoryid=abtc.categoryid
     96        left join invoicedarticles i on i.articleid=a.articleid
     97        group by c.categoryid, a.articleid
     98        having coalesce(sum(i.quantity), 0)=(
     99                select max(vkol) from
     100                (
     101                        select coalesce(sum(i.quantity),0) as vkol from articles a
     102                        left join article_belongs_to_category abtc on abtc.articleid=a.articleid
     103                        left join categories c on c.categoryid=abtc.categoryid
     104                        left join invoicedarticles i on i.articleid=a.articleid
     105                        group by c.categoryid, a.articleid
     106                ) q1
     107        )
     108
     109
     110}}}