Query 1:

select 
 distinct ifnull(concat(UPPER(JSON_EXTRACT_SCALAR(Profiles.DATA,'$.firstName')) , ' ', upper(JSON_EXTRACT_SCALAR(Profiles.DATA,'$.lastName'))),"-")  AS VendorName,
        ifnull(UPPER(JSON_EXTRACT_SCALAR(Product.DATA, '$.category')),"-") as productCategory
        from
        `roque-prod.profiles.profiles_raw_latest` as Profiles , `roque-prod.roqueprod.roque_raw_latest` as Product
        where
        Profiles.document_id = JSON_EXTRACT_SCALAR(Product.Data,'$.author')

Query 2 :

select 
 distinct ifnull(concat(UPPER(JSON_EXTRACT_SCALAR(Profiles.DATA,'$.firstName')) , ' ', upper(JSON_EXTRACT_SCALAR(Profiles.DATA,'$.lastName'))),"-")  AS VendorName,
                    ifnull(UPPER(JSON_EXTRACT_SCALAR(Services.DATA, '$.category')),"-") as ServicesCategory
                    from
                    `roque-prod.profiles.profiles_raw_latest` as Profiles , services.services_raw_latest as Services
                    where
                    Profiles.document_id = JSON_EXTRACT_SCALAR(Services.Data,'$.author')

After joining I want to get 3 columns , 1)VendorName 2)ProductCategory 3)ServiceCategory which are group by VendorName.

0

There are 0 best solutions below