A
A
Andrey Shiryaev2014-06-04 17:51:54
MySQL
Andrey Shiryaev, 2014-06-04 17:51:54

How to exclude certain columns from a query in SQL?

Plain SELECT with a lot of necessary columns and a couple of unnecessary ones.
How best to choose them so as not to list everything separated by commas?
Something like:
SELECT *, !id, !name
Is there any syntax for this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2014-06-04
@BuriK666

there is no such thing in SQL

R
RomanoFFUA, 2014-06-05
@RomanoFFUA

You can't do that. Also, it is not recommended to use SELECT * FROM .... Therefore, by listing the columns, you will kill two birds with one stone.

V
VaRaS, 2022-04-14
@VaRaS

https://www.sql-ex.ru/help/select20.php?Lang=0
to different sql databases

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question