我是SQL查询的新手.
如何将这两个查询组合成一个,以便我可以得到一个单一的结果集?
查询1:
"SELECT SUM("+Fdays+")AS fDaysSum From tblFieldDays WHERE tblFieldDays.NameCode=35 AND tblFieldDays.WeekEnding=?"
查询2:
SELECT SUM("+CHdays+") AS hRSSum From tblChargeHours WHERE tblChargeHours.NameCode=35 AND tblChargeHours.WeekEnding=? "
谢谢.
解决方法
您可以在查询中同时查询和选择它们
http://sqlfiddle.com/#!2/ca27b/1
http://sqlfiddle.com/#!2/ca27b/1
SELECT x.a,y.b FROM (SELECT * from a) as x,(SELECT * FROM b) as y