Changes between Version 3 and Version 4 of AdvancedReports


Ignore:
Timestamp:
02/03/24 20:30:26 (8 months ago)
Author:
201171
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v3 v4  
    4343    )
    4444}}}
     45
     46=== Извештај за сите продукти кои се нарачани во последните 6 месеци и нивната просечна оценка, подредени според категорија, име на продут и просечна оценка
     47
     48{{{
     49select
     50    category.category_name as category,
     51    product.product_name as product_name,
     52    avg(review.review_rating) as average_rating
     53from
     54    category
     55join product_is_in_category on category.category_id = product_is_in_category.category_id
     56join product on product_is_in_category.product_id = product.product_id
     57join order_table_contains_product on product.product_id = order_table_contains_product.product_id
     58join order_table on order_table_contains_product.order_id = order_table.order_id
     59join review on product.product_id = review.product_id
     60where
     61    order_table.order_date between now() - interval '6 months' and now()
     62group by
     63    category.category_name,
     64    product.product_name
     65order by
     66    category, product_name, average_rating;
     67}}}