B
bnhcomputing
Table 1:
SalePerson_ID, SalesPersonName.
Table 2:
SalesPerson_ID, SaleDate
The two tables are joined by SalesPerson_ID.
SELECT * FROM Table1 AS T1 INNER JOIN Table2 AS T2 ON
T1.SalesPerson_ID = T2.SalesPerson_ID
Gives back all sales, I only want the last five (5) for EACH sales
person.
There needs to be some sort of "SELECT TOP 5" and "ORDER BY SalesDate
DESC" but I be damned if I can see it.
SELECT TOP 5 * FROM Table1 AS T1 INNER JOIN Table2 AS T2 ON
T1.SalesPerson_ID = T2.SalesPerson_ID
ORDER BY T2.SaleDate DESC
Gives me the last five sales, not the last five for EACH sales person.
Suggestions?
SalePerson_ID, SalesPersonName.
Table 2:
SalesPerson_ID, SaleDate
The two tables are joined by SalesPerson_ID.
SELECT * FROM Table1 AS T1 INNER JOIN Table2 AS T2 ON
T1.SalesPerson_ID = T2.SalesPerson_ID
Gives back all sales, I only want the last five (5) for EACH sales
person.
There needs to be some sort of "SELECT TOP 5" and "ORDER BY SalesDate
DESC" but I be damned if I can see it.
SELECT TOP 5 * FROM Table1 AS T1 INNER JOIN Table2 AS T2 ON
T1.SalesPerson_ID = T2.SalesPerson_ID
ORDER BY T2.SaleDate DESC
Gives me the last five sales, not the last five for EACH sales person.
Suggestions?