【发布时间】:2011-04-18 06:21:46
【问题描述】:
where a.system_nr =''''5300'''' and
a.external_status_cd = '''''''' and
a.cust_acct_id = b.rel_cust_acct_id and
b.cust_acct_id = c.cust_acct_id and
c.cust_acct_id = d.cust_acct_id and
d.acct_status_cd = ''''OPEN'''' and
d.time_mnth_gen_id =''''' + @BegDate + ''''' and
a.cust_acct_id = e.cust_acct_id and
e.tran_dt >=''''' + @BegDate + ''''' and
e.tran_dt<=''''' + @EndDate + ''''' and
d.portfolio_cd = ''''HEQ'''' and
a.time_mnth_gen_id =''''' + @BegDate + ''''' '')'
这里是已经写好的where条件,我需要修改一下。
你能告诉我他们为什么使用'''''+@begdate'''''吗?我可以使用'+Bedate' 吗?
我的意思是为什么他们每边都使用'''''?
【问题讨论】:
-
因为列值中包含单引号?
-
我怀疑您认为构建动态查询的完整语句太大而无法包含在您的问题中。但是在完整版本上显示哪对引号包含什么会容易得多。尽管如此,基本上答案是:它与引用引号字符(
')有关。
标签: sql-server toad