SQLScholar
Programmer
Hey all,
I have this query - which isnt quite doing what i want.
Basically my problem is i want to bring out the top teamname of this query for each username (ordered by the order by clause).
Now i keep thinking its something to do with RANK by but i cant just put my finger on what i need to do.
Any help much appreaciated.
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
I have this query - which isnt quite doing what i want.
Code:
SELECT tblPolicyBrokerTeam.TeamName ,
UserName
FROM adw.policy.tblAcceptedByUser
INNER JOIN adw.policy.tblPolicyBrokerTeam
ON tblAcceptedByUser.BrokerTeamId = tblPolicyBrokerTeam.PolicyBrokerTeamId
ORDER BY UserStatus ,
tblAcceptedByUser.ADWLoadDate DESC ,
tblAcceptedByUser.ADWUpdateDate DESC
Basically my problem is i want to bring out the top teamname of this query for each username (ordered by the order by clause).
Now i keep thinking its something to do with RANK by but i cant just put my finger on what i need to do.
Any help much appreaciated.
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Bernard Baruch
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------