gridview怎么求一行合计有具体的写法吗?
1个回答
展开全部
SELECT branch_no, agent_no, name, pol_code, premt,date
FROM t1
WHERE (date = @date) AND (branch_no LIKE @branch_no) AND (LEFT (agent_no, 5) LIKE @tjagent_no)
union all
select '','','','合计:',sum(premt),'' from t1
WHERE (date = @date) AND (branch_no LIKE @branch_no) AND (LEFT (agent_no, 5) LIKE @tjagent_no
FROM t1
WHERE (date = @date) AND (branch_no LIKE @branch_no) AND (LEFT (agent_no, 5) LIKE @tjagent_no)
union all
select '','','','合计:',sum(premt),'' from t1
WHERE (date = @date) AND (branch_no LIKE @branch_no) AND (LEFT (agent_no, 5) LIKE @tjagent_no
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询