I have a table contain 22 columns
I have a query need to SELECT
20 columns
Is any way to do a query like NOT SELECT (the columns i don't want to select)
So I don't need to type SELECT column1, columns2...
I have a table contain 22 columns
I have a query need to SELECT
20 columns
Is any way to do a query like NOT SELECT (the columns i don't want to select)
So I don't need to type SELECT column1, columns2...
You cannot do it as you expected. You have to type all the columns you want. If you have run the query many times, you can create a VIEW with selected columns.
The only way is to specify the columns you want or use the '*' wildcard
SELECT * FROM TABLE
or
SELECT column1, column2...
SQL doesn't allow to hide some columns. You can either select all columns by using SELECT * ...
or list columns you need by SELECT col1, col2, ...
Please check this answer. It is the only way to do that
Select all columns except one in MySQL?
(I can't comment so I put the link as an answer)
Cheers
No it is not possible, the expression "select all except"
or "NOT SELECT"
has not yet been implemented in any existing database.