export_table_query
Execute SQL queries on IoTDB databases and export results directly to CSV or Excel files for easy data analysis and reporting.
Instructions
Execute a query and export the results to a CSV or Excel file.
Args: query_sql: The SQL query to execute (using TABLE dialect, time using ISO 8601 format, e.g. 2017-11-01T00:08:00.000) format: Export format, either "csv" or "excel" (default: "csv") filename: Optional filename for the exported file. If not provided, a unique filename will be generated.
SQL Syntax: SELECT ⟨select_list⟩ FROM ⟨tables⟩ [WHERE ⟨condition⟩] [GROUP BY ⟨groups⟩] [HAVING ⟨group_filter⟩] [FILL ⟨fill_methods⟩] [ORDER BY ⟨order_expression⟩] [OFFSET ⟨n⟩] [LIMIT ⟨n⟩];
Returns: Information about the exported file and a preview of the data (max 10 rows)
Input Schema
Name | Required | Description | Default |
---|---|---|---|
filename | No | ||
format | No | csv | |
query_sql | Yes |