p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   using DISTINCT (http://p2p.wrox.com/showthread.php?t=82012)

adamhw December 23rd, 2010 09:40 AM

Hi there

I'm wanting to use in my sQl statement:

SELECT DISTINCT TOP 5 - it doesn't seem to be working for me at the moment since the top 5 that appear are not unique.

Where am I going wrong?



Old Pedant December 23rd, 2010 04:37 PM

Show the full query.

Remember, DISTINCT means "distinct in *ALL* the fields SELECTed".

If *ANY* field in the SELECT is different, then that record can *NOT* be combined with other records and so it will be DISTINCT.

All times are GMT -4. The time now is 10:09 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.