Query CSV with SQL
Use the tool on this page to write SQL to query CSV data
What can this tool do?
Query CSV with SQL:
Query CSV via SQL and output CSV or JSON results
What else?
See also
CSV To JSON
CSV To Delimited
Step 1: Select your input
Enter Data
Choose File
Enter URL
Choose File
Encoding
-Default-
ISO-8859-1 (Latin No. 1)
ISO-8859-2 (Latin No. 2)
ISO-8859-3 (Latin No. 3)
ISO-8859-4 (Latin No. 4)
ISO-8859-5 (Latin/Cyrillic)
ISO-8859-6 (Latin/Arabic)
ISO-8859-7 (Latin/Greek)
ISO-8859-8 (Latin/Hebrew)
ISO-8859-9 (Latin No. 5)
ISO-8859-13 (Latin No. 7)
ISO-8859-15 (Latin No. 9)
Mac OS Roman
UTF-8
UTF-16
UTF-16 (Big-Endian)
UTF-16 (Little-Endian)
UTF-32
UTF-32 (Big-Endian)
UTF-32 (Little-Endian)
windows-1250 (Win East European)
windows-1251 (WinCyrillic)
windows-1252 (WinLatin-1)
windows-1253 (WinGreek)
windows-1254 (Win Turkish)
windows-1255 (Win Hebrew)
windows-1256 (Win Arabic)
windows-1257 (Win Baltic)
windows-1257 (Win Vietnamese)
Enter URL as data source
Step 2: Choose input options
(optional)
Input Options
First row is column names
Limit # of lines:
Skip # of Lines
Field Separator:
Auto Detect
,
;
:
Bar-|
Tab
Caret-^
Space
Replace Accents/Diacriticals
Treat all Quoting Character as data
Input CSV Quoting Character is Apostrophe
CSV contains backslash escaping like \n, \t, and \,
Step 3: Choose output options
Generate SQL via Output Options
Replace value of NULL in CSV with an empty value
Output Format:
CSV(Delimited)
JSON
Display Output Header on CSV
Output Field Separator on CSV:
,
;
:
Bar-|
Tab
Other-Choose
Or write your own SQL below
Step 4: Write SQL and Run
Note - Column names are case-sensitive. Table name is ?.
INTO CSV()
produces CSV, JSON is produced without it.
SQL documentation available at
AlaSQL.org
SELECT * INTO CSV() FROM ? WHERE 1=1
Result Data:
Save your result:
Download Result
EOL:
CRLF
LF
Save the complete data and settings, and then later Load them from your saved file.
Load Form
Save Form (data and settings)