Blogging is... contagious

Random witterings about programming, mainly about .NET. Occasionally even contains correct info.

Tuesday, March 06, 2007

Selecting random records from a database table

A little nugget I picked up from my colleague Wim today, that was actually his first blog post a few years back.

Need a random sample of data from your database? Try this:

SELECT TOP 10 * FROM Orders ORDER BY NEWID()
Posted by Unknown at 10:05
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2014 (1)
    • ►  August (1)
  • ►  2011 (1)
    • ►  April (1)
  • ►  2010 (2)
    • ►  July (1)
    • ►  May (1)
  • ▼  2007 (5)
    • ►  April (1)
    • ▼  March (3)
      • UpdatePanel still performing full postback
      • Selecting random records from a database table
      • DeflateStream and zlib headers
    • ►  February (1)
  • ►  2006 (16)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  March (1)
    • ►  February (4)
    • ►  January (5)

About Me

Unknown
View my complete profile
Ethereal theme. Powered by Blogger.