存储过程CREATE PROC upGetUserName
@intGp_cq_lxin int,
@varGp_kl2 varchar(20),
@intgongp_id int,
@nugp_tmp_sd_dd numeric(9,6)
AS
BEGIN
select count(fg) as y from (select distinct gp_tmp_zhhm as fg from chjdr_temp where Gp_cq_lxin=@intGp_cq_lxin and Gp_leixin >0 and Gp_kl like '%@varGp_kl2%'
and g_gongp_id=@intgongp_id GROUP BY gp_tmp_zhhm having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd) as j
END
GO
ASP调用'exec upGetUserName 0,'2010',19,'189.661' set rsmi=Server.CreateObject("ADODB.Recordset")
sql = "exec upGetUserName "&iGpcq_lxin&",'"&Gp_kl2&"',"&gongp_id&",'"&gp_tmp_sd_dd&"'"
Response.Write(sql)
rsmi.open sql,conn,3,2结果是0exec upGetUserName 0,'2010',19,'189.661' 在查询分析器里执行后结果也是0把数据带入SQL语句里结果正常/
@intGp_cq_lxin int,
@varGp_kl2 varchar(20),
@intgongp_id int,
@nugp_tmp_sd_dd numeric(9,6)
AS
BEGIN
select count(fg) as y from (select distinct gp_tmp_zhhm as fg from chjdr_temp where Gp_cq_lxin=@intGp_cq_lxin and Gp_leixin >0 and Gp_kl like '%@varGp_kl2%'
and g_gongp_id=@intgongp_id GROUP BY gp_tmp_zhhm having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd) as j
END
GO
ASP调用'exec upGetUserName 0,'2010',19,'189.661' set rsmi=Server.CreateObject("ADODB.Recordset")
sql = "exec upGetUserName "&iGpcq_lxin&",'"&Gp_kl2&"',"&gongp_id&",'"&gp_tmp_sd_dd&"'"
Response.Write(sql)
rsmi.open sql,conn,3,2结果是0exec upGetUserName 0,'2010',19,'189.661' 在查询分析器里执行后结果也是0把数据带入SQL语句里结果正常/
(
select distinct gp_tmp_zhhm as fg
from chjdr_temp
where Gp_cq_lxin=@intGp_cq_lxin
and Gp_leixin >0
and Gp_kl like '%'+@varGp_kl2+'%' ---修改
and g_gongp_id=@intgongp_id
GROUP BY gp_tmp_zhhm
having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd
) as j
select count(fg) as y from (select distinct gp_tmp_zhhm as fg from chjdr_temp where Gp_cq_lxin=@intGp_cq_lxin and Gp_leixin >0 and Gp_kl like "%'+@varGp_kl2+'%"
and g_gongp_id=@intgongp_id GROUP BY gp_tmp_zhhm having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd) as j
(
select distinct gp_tmp_zhhm as fg
from chjdr_temp
where Gp_cq_lxin=@intGp_cq_lxin and Gp_leixin >0 and Gp_kl like '%' + @varGp_kl2 + '%' --这里写错了。
and g_gongp_id=@intgongp_id
GROUP BY gp_tmp_zhhm
having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd
) as j
dawugui
(爱新觉罗.毓华) 等 级:
3
更多勋章 #4楼 得分:0回复于:2010-09-27 09:24:37SQL codeselect count(fg) as y from
(
select distinct gp_tmp_zhhm as fg
from chjdr_temp
where Gp_cq_lxin=@intGp_cq_lxin and Gp_leixin >0 and Gp_kl like '%' + @varGp_kl2 + '%' --这里写错了。
and g_gongp_id=@intgongp_id
GROUP BY gp_tmp_zhhm
having sum(gp_tmp_sd)>=@nugp_tmp_sd_dd
) as j