Jul 18, 2003 #1 ASmee IS-IT--Management Jul 9, 2002 46 US The following command does not work: select top 10 (distinct(exposureid)) from iinstrumentid The table contains duplicate exposureids, so all I want are the top 10 distinct exposureids.
The following command does not work: select top 10 (distinct(exposureid)) from iinstrumentid The table contains duplicate exposureids, so all I want are the top 10 distinct exposureids.
Jul 18, 2003 Thread starter #2 ASmee IS-IT--Management Jul 9, 2002 46 US the answers is..... select distinct(exposureid) from iinstrumentidmaster where exposureid in (select top 10 exposureid from iinstrumentidmaster) Upvote 0 Downvote
the answers is..... select distinct(exposureid) from iinstrumentidmaster where exposureid in (select top 10 exposureid from iinstrumentidmaster)
Jul 18, 2003 #3 Sabnac Programmer Dec 8, 2002 41 BE In this case, you will have the distinct value of the 10 top rows. If the top 10 rows are the same you will get 1 rows. Try this : SELECT TOP 10 exposureid FROM iinstrumentid GROUP BY exposureid Upvote 0 Downvote
In this case, you will have the distinct value of the 10 top rows. If the top 10 rows are the same you will get 1 rows. Try this : SELECT TOP 10 exposureid FROM iinstrumentid GROUP BY exposureid
Jul 18, 2003 #4 SQLSister Programmer Jun 18, 2002 7,292 US Did you try: Select distinct top 10 exposureid from instrumentid Upvote 0 Downvote
Jul 18, 2003 #5 LokiDba Programmer Dec 13, 2000 63 GB You could also try SET ROWCOUNT 10 -- Return only the first 10 rows SELECT DISTINCT exposureid FROM instrumentid SET ROWCOOUNT 0 -- Reset row count to all Hope of some use Andy (LokiDBA) Upvote 0 Downvote
You could also try SET ROWCOUNT 10 -- Return only the first 10 rows SELECT DISTINCT exposureid FROM instrumentid SET ROWCOOUNT 0 -- Reset row count to all Hope of some use Andy (LokiDBA)