I'd like to do something like this (pseudocode):
SELECT t.id, t.name, c.created
FROM 'path/to/input.csv' AS csv(id INT, created TIMESTAMP)
JOIN some_table AS t
ON csv.id = t.id
INTO OUTFILE 'path/to/output.csv'
I could only find LOAD DATA INFILE
which needs INTO TABLE tbl_name
.
What I'd like to have:
- only SQL
- read-only access to the database
- single statement
Is that possible?