If the sub-query is not correlated, you can (always) transform it into a simple join query.
However, the query you show is no valid SQL... Did you mean:
SELECT C_CUSTKEY,C_NAME
FROM Customers
WHERE C_MKTSEGMENT =
(SELECT C_MKTSEGMENT FROM Customers WHERE C_ADDRESS="MG9kdTD2WBHm")
In this case, you can transform it into:
SELECT c1.C_CUSTKEY, c1.C_NAME
FROM Customers AS c1, Customers AS c2
WHERE c1.C_MKTSEGMENT = c2.C_MKTSEGMENT
AND c2.C_ADDRESS="MG9kdTD2WBHm"
-Matthias
On 05/05/2015 06:01 PM, hager sallah wrote:
> how can implemented subquery in flinkexample
> SELECT C_CUSTKEY,C_NAME
> FROM Customers where C_MKTSEGMENT=(select C_CUSTKEY,C_MKTSEGMENT from
> Customers where C_ADDRESS="MG9kdTD2WBHm")
>
>
>
>
signature.asc
Description: OpenPGP digital signature
