[Table design]:
I inserted to the table using:
INSERT INTO Orders
VALUES (N'Test', 10, 20)
[Data in the table]:
Now when I try to set a query to get row in the table by user name.
So I used the query:
SELECT *
FROM Orders
WHERE User = N'Test'
Trying to get the row by User:
But I get zero results from the query although the table have a row with the User "Test".
For testing I tried to do the same thing but search by the ItemId
or ItemAmount
and it returns results.
Searching by int returns result
I am new about using SQL Server .mdf
database files. But not with .db and SQL query.
So how can I fix the problem or get the unique User row, without adding another col to the table?
You need to escape column name with []
:
SELECT * FROM Orders WHERE [User] = N'Test';
In SQL Server User
<> [User]
:
SELECT User, [User]
FROM Orders;