sql server 包含' 不能查询 怎么办?有什么方法可以替代吗?

laoyingisme 2010-05-18 12:33:37
Select * from tbnwcClientList where Survey_Period='Feb'10' group by Project_Coordinator
...全文
102 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
laoyingisme 2010-05-18
  • 打赏
  • 举报
回复
Thanks very much for htl258
laoyingisme 2010-05-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 htl258 的回复:]
SQL code
Select Project_Coordinator from tbnwcClientList where Survey_Period='Feb''10' group by Project_Coordinator
[/Quote]
I try it and run ok.
htl258_Tony 2010-05-18
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 feixianxxx 的回复:]
Select * from tbnwcClientList where Survey_Period='Feb'10'
group by Project_Coordinator

.这样分组 能成么。。。
[/Quote]不成,估计楼主是出于提问错误的简化了。但我们只有针对问题点,没管它。
feixianxxx 2010-05-18
  • 打赏
  • 举报
回复
Select * from tbnwcClientList where Survey_Period='Feb'10'
group by Project_Coordinator

.这样分组 能成么。。。
永生天地 2010-05-18
  • 打赏
  • 举报
回复
declare @Survey_Period varchar(20)
set @Survey_Period = 'Feb''10'
Select *
from tbnwcClientList
where Survey_Period=@Survey_Period group by Project_Coordinator
htl258_Tony 2010-05-18
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 laoyingisme 的回复:]
Survey_Period='Feb'10'

本来就是string 有能转化成变量 “@Survey_Period”,该怎么办?
[/Quote]

SET @Survey_Period='Feb''10'
laoyingisme 2010-05-18
  • 打赏
  • 举报
回复
Survey_Period='Feb'10'

本来就是string 有能转化成变量 “@Survey_Period”,该怎么办?
htl258_Tony 2010-05-18
  • 打赏
  • 举报
回复
Select Collist... from tbnwcClientList where Survey_Period='Feb''10' group by Project_Coordinator
dawugui 2010-05-18
  • 打赏
  • 举报
回复
[Quote=引用楼主 laoyingisme 的回复:]
Select * from tbnwcClientList where Survey_Period='Feb'10' group by Project_Coordinator
[/Quote]

Select Project_Coordinator ,
min(...),
max(...),
count(...),
sum(...),
avg(...)
from tbnwcClientList
where Survey_Period='Feb''10'
group by Project_Coordinator

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧