Open elvarb opened 5 years ago
If the field name contains spaces, it must be enclosed in quotation marks. Quotation marks depend on the database driver.
SQLite 3 is double quotes (") and backquotes (`).
echo "i d,n a m e\n1,Alice"| trdsql -driver sqlite3 'SELECT "i d", "n a m e" FROM -'
and
echo "i d,n a m e\n1,Alice"| trdsql -driver sqlite3 'SELECT `i d`, `n a m e` FROM -'
postgres is a double quotation mark (").
echo "i d,n a m e\n1,Alice"| trdsql -driver postgres 'SELECT "i d", "n a m e" FROM -'
mysql is a backquotes (`).
echo "i d,n a m e\n1,Alice"| trdsql -driver sqlite3 'SELECT `i d`, `n a m e` FROM -'
It is impossible to select a field name that contains a space.