zoukankan      html  css  js  c++  java
  • Flink基础(118):FLINK-SQL语法 (12) DQL(4) OPERATIONS(1)WITH clause (FLINK 1.13 以上)

    WITH clause 

    Batch Streaming

    WITH provides a way to write auxiliary statements for use in a larger query. These statements, which are often referred to as Common Table Expression (CTE), can be thought of as defining temporary views that exist just for one query.

    The syntax of WITH statement is:

    WITH <with_item_definition> [ , ... ]
    SELECT ... FROM ...;
    
    <with_item_defintion>:
        with_item_name (column_name[, ...n]) AS ( <select_query> )

    The following example defines a common table expression orders_with_total and use it in a GROUP BY query.

    WITH orders_with_total AS (
        SELECT order_id, price + tax AS total
        FROM Orders
    )
    SELECT order_id, SUM(total)
    FROM orders_with_total
    GROUP BY order_id;

    本文来自博客园,作者:秋华,转载请注明原文链接:https://www.cnblogs.com/qiu-hua/p/15192168.html

  • 相关阅读:
    GARP和GVRP
    VLAN间路由
    Voice VLAN
    VLAN
    SSH
    Telnet
    FTP
    DHCP
    STP
    交换机
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/15192168.html
Copyright © 2011-2022 走看看