问个C#下SQL查询语句怎么写

来源:百度知道 编辑:UC知道 时间:2024/05/20 15:30:48
根据地名查询邮政编码 这个地名下的TEXT文本的查询怎么写

让我们做一个实验:

create table test123
(
test varchar(20)
)

insert into test123 values ('text')

然后就可以在表中看到有text的一条数据

然后我们查询一下:

select * from test123 where test like '%text%'

可以显示结果!

这个时候的text是文本!不是类型!

完全匹配查询
select 邮政编码 from 表名 where 地名字段 = '地名'

模糊查询
select 邮政编码 from 表名 where 地名字段 like '%地名%'

select *from ...where

select 邮政编码 from 表名 where 地名字段=地名