SQL Server – uses NEWID() in ORDER BY

   1: -- using the AdventureWorks Database
   2: SELECT
   3:     TOP 10
   4:     DepartmentID,
   5:     [Name]
   6: FROM
   7:     HumanResources.Department
   8: ORDER BY
   9:     NEWID()
  10:

MySQL – uses RAND() in ORDER BY

   1: SELECT
   2:   `Code`,
   3:   `Name`
   4: FROM
   5:   `Country`
   6: ORDER BY
   7:   RAND()
   8: LIMIT 10;
VN:F [1.4.0_681]
Rating: 0.0/10 (0 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Related posts:

  1. Indispensible MySQL Resources ...
  2. MySQL EXPLAIN Cheat Sheet ...
  3. Generating XSD from an XML File ...
  4. Valid SQLXML XSD Data Types, and Sample SQL Server XML Schemas ...
  5. SQL Server Spatial Data for Canada ...
  6. SQLXML : How to List Columns That Have the XML Data Type ...