在数据库中有一张表 a 其中有两列 id (int) 和name (nchar)
有四行数据如下
1 abc
2 abcc
3 abccc
4 bcd
select * from a where name like 'a%c'
查询出来时空的 请问这是为什么
有四行数据如下
1 abc
2 abcc
3 abccc
4 bcd
select * from a where name like 'a%c'
查询出来时空的 请问这是为什么
调试欢乐多
like 'a%c '?
---测试数据---
if object_id('[tb]') is not null drop table [tb]
go
create table [tb]([id] int,[name] nchar(10))
insert [tb]
select 1,'abc' union all
select 2,'abcc' union all
select 3,'abccc' union all
select 4,'bcd'
---查询---
select * from tb where name like 'a%c%'---结果---
id name
----------- ----------
1 abc
2 abcc
3 abccc (3 行受影响)