Such a question arises, for example, when it is needed to present on site 3 most recent reviews within each news section, or advertisement of 5 most popular goods within each category.
In this connection I would like to suggest two solutions of the problems of the type which are solved on the site, i.e. containing one SELECT query. The first solution is of the classical type, which can be efficiently applied to the majority of DBMS, the second solution requires the use of new constructions, which have been worked out recently in SQL:1999 standard and are not so widely maintained yet.



Comments
lil replied ago:
Thank you. Useful sulution!
Voters For This Link (13)
Voters Against This Link (0)