Closed jschuur closed 2 weeks ago
After you import the CSV, you can treat it just like a table. For example:
SELECT * FROM "table.csv";
After you import the CSV, you can treat it just like a table. For example:
SELECT * FROM "table.csv";
Great, that worked, thanks!
Would be nice if that auto completed like in TablePlus. Or, even better there was an alias (source
? file
?) that I can use regardless of the actual file name. In my case the filename was quite long with a timestamp and other meta data in it.
Then I can just to SELECT count(*) FROM source
e.g.
You're able to rename the file after importing and querying the renamed (short name) file.
Yep, you can rename it right there.
Yep, you can rename it right there.
Very cool, but definitely not something I would have discovered without this thread. Thanks for pointing this out!
FWIW, I had to SELECT count(*) FROM "table"
since SELECT count(*) FROM table
without the quotes didn't work.
FWIW, I had to SELECT count() FROM "table" since SELECT count() FROM table without the quotes didn't work.
I think it is related to the SQL syntax. If there is a dot, dash, space, mixed upper case-lowercase, new lines or some special character... in the table name, you need to add quotes.
I couldn't figure out how to reference the table for SQL queries. It's using DuckDB, so even something like
SELECT * FROM read_csv("table.csv")
.Is this supported yet?