Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding some columns in a SELECT statement

Tags:

sql

select

In the result for

SELECT * from myTable WHERE some-condition;

I'm interested in 9 of all the 10 columns that exist. The only way out is to specify the 9 columns explicitly ?

I cannot somehow specify just the column I don't want to see?

like image 355
vtbose Avatar asked Nov 25 '25 22:11

vtbose


1 Answers

The only way is to list all 9 columns.

Such as:

SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9 FROM myTable
like image 190
Ben S Avatar answered Nov 28 '25 16:11

Ben S