Changes between Version 2 and Version 3 of AdvancedReports


Ignore:
Timestamp:
12/21/22 22:13:35 (22 months ago)
Author:
192011
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v2 v3  
    11= Напредни извештаи од базата (SQL и складирани процедури)
     2
     3== Местоположба на автомобили, при што со едно query имаме податоци за која компанија, кој бизнис корисник, брендот на автомобилот, моделот, дали е достапна, вид на автомобил (mini, big, hatchback),тип на менувач (автоматик, мануелен), боја на автомобил и град во кој се наоѓа автомобилот
     4{{{#!sql
     5select insq.company_name, insq.username,
     6                f.brand, f.model_name, f.valid_thru,
     7                f.is_available, f.vehicle_type,
     8                f.transmission, f.color,
     9                f.city
     10        from (
     11                select c.company_name,u.username, c.company_id
     12                        from companies c
     13                                join business_users bu
     14                                        on c.business_user_id = bu.user_id
     15                                join users u
     16                                        on bu.user_id = u.user_id               
     17        ) insq
     18                join (
     19                        select vehicle_id,
     20                                        c2.company_id, brand,
     21                                        model_name, r.valid_thru,
     22                                        r.is_available,m.vehicle_type,
     23                                        m.transmission,m.color,
     24                                        l.city
     25                                from vehicles v
     26                                        join companies c2 on v.company_id = c2.company_id
     27                                        join models m on m.model_id = v.model_id
     28                                        join registrations r on r.registration_id = v.registration_id
     29                                        join locations l on l.location_id = v.location_id
     30        ) f on insq.company_id = f.company_id
     31        order by company_name
     32
     33}}}
    234
    335== Најизнајмуван автомобил во текот на изминатите два месеци земено во однос на тековниот датум