Jul 18, 2003 #1 ASmee IS-IT--Management Joined Jul 9, 2002 Messages 46 Location 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 Joined Jul 9, 2002 Messages 46 Location 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 Joined Dec 8, 2002 Messages 41 Location 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 Joined Jun 18, 2002 Messages 7,292 Location US Did you try: Select distinct top 10 exposureid from instrumentid Upvote 0 Downvote
Jul 18, 2003 #5 LokiDba Programmer Joined Dec 13, 2000 Messages 63 Location 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)