DTStack / DTStack/dt-sql-parser
[Feature Request]: Support CTE statement entity collection
Đang mở
enhancement
improvement
- Ngôn ngữ chính
- TypeScript
- Star
- 394
- Fork
- 108
- Merge trung bình
- 3 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 2
Mô tả
### Topic
Enhance existing features
### Description
The temporary result set created in a CTE statement can be collected.
```sql
WITH sales_data AS (
SELECT product_id, SUM(amount) AS total_sales
FROM orders
WHERE order_date >= '2023-01-01'
GROUP BY product_id
),
top_products AS (
SELECT product_id, total_sales
FROM sales_data
WHERE total_sales > 10000
)
SELECT p.name, tp.total_sales
FROM top_products tp
JOIN products p ON tp.product_id = p.id
ORDER BY tp.total_sales DESC;
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.