Today, a multi-Table query, grouping, and statistics function is available. However, duplicate data occurs, and then distinct is used to solve the duplicate data. <Br/> but paging is required again. Of course, it is top. However, the stored procedure can also handle paging. Top paging is used here. <Br/> however, an error occurs when top and distinct are used. I used top and distinct before. Remember that top and distinct can be used at the same time. <Br/> finally, I checked it and finally got it done. Haha ~~~~ </P> <p> use the sysobjects table as an example. A simple example is as follows: </P> <p> 1. Remove duplicate data, count count </P> <p> select count (distinct (xtype) from sysobjects </P> <p> 2. First 100 queries, remove duplicate data <br/> select distinct Top 100 xtype from sysobjects </P> <p> same as above <br/> select count (distinct (sysstat )) from sysobjects <br/> select distinct top 10 sysstat from sysobjects <br/> select distinct top (select count (distinct (sysstat) from sysobjects) sysstat from sysobjects <br/>