sql server - why this sql query does not pass result accurately? -


i want sum(t1+t2) d result publish accurately group tblpersonalinfo.applicantid, query show me d's result group tblpersonalinfo.applicantid query show d's result incrementally.

select  distinct       t1+t2,      tblpersonalinfo.applicantid,     tblpersonalinfo.applicantname    (     select  sum(tblexperange.score)as t2        tblexperience     left outer join tblexperange          on tblexperience.exprange=tblexperange.experange      group tblexperience.applicantid     ) tblexperience,     (      select  sum(tblgradpoint.score) t1        tblacademicinfo         left outer join tblgradpoint              on tblacademicinfo.cgpa=tblgradpoint.[cgpa/division]     group tblacademicinfo.applicantid     ) tblacademicinfo,     tblpersonalinfo      inner join tblcircular          on tblpersonalinfo.cirname = tblcircular.cirname tblcircular.cirname=(tblpersonalinfo.cirname)  return 

not 100% sure query sounds might need union 2 sub-queries one, can sum in select clause...

select  sum(t) d,         y.applicantid,         y.applicantname    (         select  tblexperience.applicantid,                 sum(tblexperange.score)as t            tblexperience                 left outer join tblexperange                    on tblexperience.exprange=tblexperange.experange         group tblexperience.applicantid         union          select  tblacademicinfo.applicantid,                 sum(tblgradpoint.score) t            tblacademicinfo                 left outer join tblgradpoint                    on tblacademicinfo.cgpa=tblgradpoint.[cgpa/division]         group tblacademicinfo.applicantid         ) x         inner join tblpersonalinfo y             on x.applicantid = y.applicantid          inner join tblcircular z             on y.cirname = z.cirname  --(*) --where z.cirname=(y.cirname)   --.....maybe not required line above (*) deals group y.applicantid,         y.applicantname 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -