繁体   English   中英

SQL 查询到 CSV 或 EXCEL 格式

[英]SQL Query to CSV or EXCEL format

我想将以下内容拉入 excel 文件,但不能。

select o.*
from (
    select 
        o.*,
        min(processed_at) over(partition by contact_email) min_processed_at,
        sum(total_price)  over(partition by contact_email) sum_total_price
    from (
        select 
            o.*,
            row_number() over(partition by id) instance
        from `windy-oxide-255921.lume_shopify.orders` o
    ) o
    where instance = 1
) o
where 
    processed_at between '2019-01-01 00:00:00 UTC' and '2019-02-01 00:00:00 UTC'
    and sum_total_price > 100

有没有办法可以将其导出为 CSV 或 Excel 格式? 谁能在这里给我一些指导? 我应该在某处使用未嵌套的 function 吗? 谢谢!

如果您在 SSMS 中:

右键单击结果网格的左上角,并另存为 CSV。

可以导出到CSV ,我的建议是查看有关导出表数据的文档,您需要考虑权限限制

Exist multiple ways to perform this action for example using the BigQuery UI, CLI, API, or using client libraries like C#, Go, Python, Java, Ruby.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM