简体   繁体   中英

Can't select column that exists on a table

I'm adding 3 new columns to a table in SQL but I can't select them after adding, it just says that the columns are invalid

I added them through this command

alter table tb_example add x varchar(50) null
alter table tb_example add y varchar(50) null
alter table tb_example add z varchar(50) null

If I select * from tb_example everything appears there, but the columns are not functional, I can't insert any data or select said columns

I have no idea why this is happening, nothing similar ever happened before, anyone has any ideas on what is causing this issue?

The issue appears when I try something like select x from tb_example

x gets underlined in red and I get the error "invalid column name 'x'." when I hover my cursor ever it, but when I run a select * from tb_example x, y and z are there

This only happens when I select x, y or z, the other columns work fine

更新后就可以了,我遇到了另一个不相关的问题,而jsut希望排除这个问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM