Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1218

Re: Reducing to One Query

From Philipp Post <post.philipp@googlemail.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Reducing to One Query
Date 2012-08-17 06:23 -0700
Organization http://groups.google.com
Message-ID <9c01429a-eafd-4600-8dcf-b8b74f40036d@googlegroups.com> (permalink)
References <r8nq28hte3lhrka9pviujmo1apmopg8ult@4ax.com>

Show all headers | View raw


If this should work in MS Access you will end up with something like that - same as your query without the temp table.

SELECT S.Team, S.PlayerName
FROM Stats AS S
INNER JOIN
  (SELECT Max(pct) As max_pct, Team
   FROM Stats AS S
   GROUP BY Team) AS T1 
ON S.pct = T1.max_pct
  AND S.Team = T1.Team
;

brgds
Philipp Post

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Reducing to One Query Gene Wirchenko <genew@ocis.net> - 2012-08-16 13:54 -0700
  Re: Reducing to One Query Philipp Post <post.philipp@googlemail.com> - 2012-08-17 06:23 -0700
    Re: Reducing to One Query Gene Wirchenko <genew@ocis.net> - 2012-08-17 09:15 -0700

csiph-web