'SQL Like operator doesn't work with the letter 'N'
I have a table like this
create table NHANVIEN
(
HoNV nvarchar(15),
TenLot nvarchar(15),
TenNV nvarchar(15),
MaNV char(9),
NgSinh date,
DChi nvarchar(30),
Phai nvarchar(3),
Luong float,
Ma_NQL char(9),
PHG int,
primary key (MaNV)
);
I have problem with this query
select HoNV, TenLot, TenNV
from NHANVIEN
where TenNV like N'N%'
After executing the above query, it should have return the 3rd and the 4th row; but somehow mine didn't return any rows. I've tried with the names that don't have letter 'g' after the 'N' and it worked. Thanks for your help
Edited: the original query is where HoNV like N'N%'. I just tested with other column to check if it worked
Solution 1:[1]
It seems that my problem is due to my Vietnamese_CI_AS collation. Using the default collation should be worked
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tr??ng Samuel |
