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

Time:09-22

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 * ,c.phone AS telefon FROM accounts c;

Table:

user_id  phone    teléfono
    1    null     99999999

CodePudding user response:

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.

  • Related