You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"query": "SELECT OrderID, CustomerID, OrderDate, OrderStatus, TotalAmount FROM Orders WHERE OrderDate >= '${startDate}' AND OrderDate <= '${endDate}'"
159
+
},
160
+
"common_customers": {
161
+
"description": "공통 고객 조회 쿼리",
162
+
"query": "SELECT CustomerID, CustomerName, Region, ContactName FROM Customers WHERE region IN (${regionList})"
163
+
}
164
+
},
109
165
"vars": {
110
166
"startDate": "2024-01-01",
111
167
"endDate": "2024-06-30",
@@ -115,23 +171,96 @@ npm run help
115
171
{
116
172
"name": "Orders",
117
173
"use": true,
174
+
"queryRef": "common_orders",
118
175
"aggregateColumn": "OrderStatus",
119
176
"maxRows": 1000,
120
-
"db": "sampleDB",
121
-
"query": "SELECT * FROM Orders WHERE OrderDate >= '${startDate}' AND OrderDate <= '${endDate}'"
177
+
"db": "sampleDB"
122
178
},
123
179
{
124
180
"name": "Customers",
125
-
"use": false,
181
+
"use": true,
182
+
"queryRef": "common_customers",
126
183
"aggregateColumn": "Region",
127
184
"maxRows": 500,
128
-
"db": "erpDB",
129
-
"query": "SELECT * FROM Customers WHERE region IN (${regionList})"
185
+
"db": "erpDB"
186
+
},
187
+
{
188
+
"name": "OrderSummary",
189
+
"use": true,
190
+
"aggregateColumn": "Status",
191
+
"db": "sampleDB",
192
+
"query": "SELECT OrderStatus as Status, COUNT(*) as Count, SUM(TotalAmount) as TotalAmount FROM Orders WHERE OrderDate >= '${startDate}' AND OrderDate <= '${endDate}' GROUP BY OrderStatus"
"query": "SELECT Region, SUM(Amount) as TotalSales, COUNT(*) as OrderCount FROM Orders o JOIN Customers c ON o.CustomerID = c.CustomerID WHERE OrderDate >= '${startDate}' AND OrderDate <= '${endDate}' GROUP BY Region"
236
+
}
237
+
},
238
+
"sheets": [
239
+
{
240
+
"name": "RegionSales",
241
+
"queryRef": "sales_by_region",
242
+
"use": true,
243
+
"db": "sampleDB"
244
+
},
245
+
{
246
+
"name": "RegionSales_Copy",
247
+
"queryRef": "sales_by_region",
248
+
"use": true,
249
+
"db": "sampleDB"
130
250
}
131
251
]
132
252
}
133
253
```
134
254
255
+
#### 속성 설명
256
+
257
+
| 속성 | 설명 | 필수 | 예시 |
258
+
|------|------|------|------|
259
+
|`queryRef`| 참조할 쿼리 정의 이름 | 선택 |`"common_orders"`|
260
+
|`query`| 직접 SQL 쿼리 (기존 방식) | 선택 |`"SELECT * FROM Orders"`|
261
+
262
+
**주의:**`queryRef`와 `query` 중 하나만 사용해야 합니다. `queryRef`가 있으면 `query`는 무시됩니다.
0 commit comments