Skip to content
Advertisement

Select * From Table Where column=data is not working [closed]

I am using SQL Server. The following query is working fine:

select * 
from Users 
where Users.Id = 1

but when I use

select * 
from Users 
where Users.Username = "User"

this does not work.

Error:

Invalid Column name

Advertisement

Answer

Use on quote instead of double quote

select * from Users where Users.Username = 'User'

text datatype has been deprecated, you need to change the datatype to VARCHAR(n)/NVARCHAR(n) as it depends on your data and your needs.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement