how can i specify the column i don't want to display?

I want to show all the remaining data in the table except some columns. However, despite doing a lot of research, I get stuck in many places. What is the logic of this?

SELECT * , AS telefon FROM accounts c;


user_id  phone    teléfono
    1    null     99999999

>Solution :

You can’t do that. Instead, you specify the columns that you do want.

SELECT column_a, column_b, column_x FROM table;

It is a good idea in query to really only specify the columns that you really need. Otherwise you are in for surprises if the table schema might change in the future.

Leave a Reply