Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQL] Support Common Table Expressions #514

Closed
BohuTANG opened this issue May 11, 2021 · 2 comments
Closed

[SQL] Support Common Table Expressions #514

BohuTANG opened this issue May 11, 2021 · 2 comments
Assignees
Labels
A-query Area: databend query C-feature Category: feature
Milestone

Comments

@BohuTANG
Copy link
Member

Summary

WITH provides a way to write subqueries for use in a larger SELECT query.
References:
https://www.postgresql.org/docs/8.4/queries-with.html
https://clickhouse.tech/docs/en/sql-reference/statements/select/with/

@BohuTANG BohuTANG added C-feature Category: feature A-query Area: databend query labels May 11, 2021
@l1t1
Copy link

l1t1 commented May 13, 2021

not yet. but the error message is wrong

@kylin-gtj:~$ cd fuse
kylin@kylin-gtj:~/fuse$ chmod +x fusequery-v0.4.1-alpha-linux-aarch64
kylin@kylin-gtj:~/fuse$ nohup ./fusequery-v0.4.1-alpha-linux-aarch64 &
[1] 15349
kylin@kylin-gtj:~/fuse$ nohup: 忽略输入并把输出追加到'nohup.out'

kylin@kylin-gtj:~/fuse$ pgrep fuse
2362
15349
kylin@kylin-gtj:~/fuse$ mysql -h127.0.0.1 -P3307
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.10-alpha-msql-proxy

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select (number+1) as c1, number/2 as c2 from numbers_mt(10000000) where (c1+c2+1) < 100 limit 3;
+------+------+
| c1   | c2   |
+------+------+
|    1 |    0 |
|    2 |  0.5 |
|    3 |    1 |
+------+------+
3 rows in set (0.00 sec)

mysql> with t as (select (number+1) as c1, number/2 as c2 from numbers_mt(10000000) where (c1+c2+1) < 100 limit 3)select * from t;
ERROR 1105 (HY000): Code: 25, displayText = DataSource Error: Unknown table: 't'.

@BohuTANG BohuTANG added SQL prio: low Low priority labels May 14, 2021
@BohuTANG BohuTANG removed the prio: low Low priority label Jun 4, 2021
@BohuTANG BohuTANG changed the title Support Common Table Expressions [CTE] Support Common Table Expressions Jun 4, 2021
@BohuTANG BohuTANG changed the title [CTE] Support Common Table Expressions [SQL] Support Common Table Expressions Jun 4, 2021
@BohuTANG BohuTANG removed the SQL label Oct 16, 2021
@Xuanwo Xuanwo added this to the v0.8 milestone May 20, 2022
@fkuner fkuner self-assigned this Jul 13, 2022
@xudong963
Copy link
Member

close by #7056

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query C-feature Category: feature
Projects
None yet
Development

No branches or pull requests

5 participants