I have many columns in a table and wanted to SELECT * FROM Table
except for one column (ex: location) without having to list all the columns I want to use.
SELECT * EXCEPT id FROM Table
???
To select data from an SQLite database, use the SELECT statement. When you use this statement, you specify which table/s to select data from, as well as the columns to return from the query. You can also provide extra criteria to further narrow down the data that is returned.
SQLite select specific columns We can use the SELECT statement to retrieve specific columns. The column names follow the SELECT word. We retrieve the Name and the Price columns. The column names are separated by commas.
The EXCEPT operator returns all records from the first SELECT statement that are not in the second SELECT statement. The EXCEPT operator in SQLite is equivalent to the MINUS operator in Oracle.
Absolutely, no.
But here's a workaround. Create a VIEW
of the table, eg
CREATE VIEW ViewName
AS
SELECT col1, col2, col3, .... -- don't select the column name you want to hide
FROM tableName;
once the VIEW
was created, you can now call it,
SELECT * FROM ViewName
No, you cannot do that.
You list the ones you need, or you accept that the result set contains one more column than you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With