我目前有两个选择命令如下.我想做的是将结果加在SQL查询中而不是代码中的变量.
select sum(hours) from resource; select sum(hours) from projects-time;
解决方法
@H_301_9@ 是.有可能:DSELECT SUM(totalHours) totalHours FROM ( select sum(hours) totalHours from resource UNION ALL select sum(hours) totalHours from projects-time ) s
作为旁注,tablename项目时间必须分隔,以避免语法错误.您使用的RDBMS上的分隔符符号不同.