vb.net - Grouping and Joining a Unioned Table. Having Problems -
the other day asked question , received helpful information assisted me far. having trouble taking data tables using union/group by. the following code have tried. cannot seem find way make group player. it showing this. jono - 3 - 1 jono - 1 - 1 when need show this jono - 4 - 1 i beginning if there better way perform code, please tell me :) select [player],[played],[games won] (select p1.displayname [player], count(p1.displayname) [played], sum(iif(m.player2=m.winner, 1, 0)) [games won] ((tblmatch m) inner join tblplayers p1 on m.player2=p1.id) m.season = 3 group p1.displayname union select p2.displayname [player2], count(p2.displayname) [played], sum(iif(m.player1=m.winner, 1, 0)) [games won] ((tblmatch m) inner join tblplayers p2 on m.player1=p2.id) m.season = 3 group p2.displayname) my database layout is: tblplayers (id,firstname,lastname,displayname,handicap,current) tblseason (id,season) tblmatch (id,matchdate,season,player1,player2,player1score,pla...