PasteZap
🌐 简体中文
免费 · 无需注册

免费 · 开发

对 CSV 和 JSON 文件执行 SQL 查询.

在浏览器中对 CSV、TSV 和 JSON 文件执行 SQL 查询:每个文件都成为一张表,可筛选、分组和关联,并导出结果。

开始之前

部分技术控件使用英语。支持 Unicode 文本;文件格式和输出语言取决于具体工具。

下面以英语列出技术限制。处理大型文件或使用结果之前,请先查看这些限制。

Drop CSV, TSV or JSON files here or

Each file becomes a table you can query and join · up to 200 MB and 500,000 rows per file · nothing is uploaded

Column types are detected (INTEGER, REAL or TEXT); empty cells become NULL. Queries use SQLite syntax.

用 SQL 查询 CSV 文件

  1. 拖入一个或多个 CSV、TSV 或 JSON 文件,或点击 Try with sample data。
  2. 每个文件都会成为以文件名命名的表(例如 sales_2026);其列和识别出的类型显示在左侧。
  3. 编写类似 SELECT country, SUM(quantity * unit_price) AS revenue FROM orders GROUP BY country 的查询,然后点击 Run query (Ctrl+Enter)。
  4. 把结果导出为 CSV 或 JSON,或下载整个数据库,在 SQLite 查看器 中继续使用。

使用示例文件 orders.csv 时,该查询把德国以 91.8 排在第一,法国以 83.4 排在第二。

类型、关联和限制

列类型根据数值自动识别:整数为 INTEGER,小数为 REAL,其余为 TEXT;空单元格为 NULL。超过 15 位的整数(如编号或卡号)保留为 TEXT,以免丢失数字。加载多个文件即可按共同列进行关联(JOIN)。

每个文件最多 500,000 行、200 MB,每个结果最多显示 10,000 行。如需手动编辑单元格,请使用 CSV 查看与编辑器。

限制与支持格式

输入内容在您的设备上处理。

英语技术说明

Up to 200 MB and 500,000 rows per file; results show up to 10,000 rows per query. Column types are detected automatically (INTEGER, REAL or TEXT). SQLite syntax.

Files are parsed with Papa Parse (CSV/TSV) or JSON.parse and loaded into an in-memory SQLite database (sql.js) in a background worker; tables can be joined and the whole database downloaded.

With the sample orders.csv, SELECT country, SUM(quantity * unit_price) AS revenue FROM orders GROUP BY country ORDER BY revenue DESC ranks the countries by revenue.

常见问题

我的文件会被上传吗?

不会。文件在浏览器中解析,并载入在后台 worker 中以 WebAssembly 运行的 SQLite。

可以使用哪些 SQL?

SQLite 语法:SELECT、WHERE、GROUP BY、JOIN、窗口函数、CREATE TABLE AS 等。

可以关联两个 CSV 文件吗?

可以。添加两个文件后,每个都会成为一张表,可在一条查询中关联。