Access Patterns we have seen
We review some of the common patterns we have used. IMPORTANT NOTE: SQL is given for informational purpose only. We have not covered SQL but used the Query Builder instead.
Table IDABC 1a1b15 2a1b18 3a1b27 4a1b22 5a1b21 6a2b17 7a2b18 8a3b20
What we want: summing for distinguished column of another column ASumOfC a123 a215 a30
SQL query SELECT Table1.A, Sum(Table1.C) AS SumOfC FROM Table1 GROUP BY Table1.A;
Query Builder Manipulation Create Query Choose Table1 Select column A Select column C Totals (GroupBy default) Sum for column C
Table IDABC 1a1b15 2a1b18 3a1b27 4a1b22 5a1b21 6a2b17 7a2b18 8a3b20
What we want: Counting for distinguished column BCountOfB b14 b24
SQL SELECT Table1.B, Count(Table1.B) AS CountOfB FROM Table1 GROUP BY Table1.B;
Query Builder Manipulation Create Query Select Table1 Select column B Totals (GroupBy) For second column B choose count
Table2 (DebateResults) IDwinnerloserforced
What we want: count wins for each debater winnerCountOfwinner
SQL SELECT Table2.winner, Count(Table2.winner) AS CountOfwinner FROM Table2 GROUP BY Table2.winner;
Query Builder Manipulation Create Query Choose Table2 Select winner column twice Totals (GroupBy) For second winner column: Count
Table2 (DebateResults) IDwinnerloserforced
What we want: count faults FaulterCountOfFaulter
Add calculated field for Faulters: subquery What do we want for the subquery?
Create Faulter column from Loser column Faulterforced
SQL SELECT Table2.loser AS Faulter, Table2.forced FROM Table2 WHERE (((Table2.loser)<>[forced]));
Query Builder Manipulation Create Query select loser column; rename to Faulter; condition <>[forced] select forced column (for checking result) name subquery: Faults
Reminder: What we want FaulterCountOfFaulter
SQL SELECT Faults.Faulter, Count(Faults.Faulter) AS CountOfFaulter FROM Faults GROUP BY Faults.Faulter;
Query Builder Manipulation Create Query Choose subquery Faults Select Faulter column twice Totals (GroupBy) select Count for second