0

查询一:

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')

查询 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')

加入后,我想获得 3 列,1)VendorName 2)ProductCategory 3)ServiceCategory,它们是按 VendorName 分组的。

4

0 回答 0