Returning random records.. MS SQL Server vs. MySQL by Microsoft Windows XP

Tue, 02 Oct 2007 23:01:45 +0400

Returning random records.. MS SQL Server vs. MySQL

by Microsoft Windows XP @ Tue, 02 Oct 2007 23:01:45 +0400

Routinely it's busy to net a frequency of random records from a database. Being van a \"tip of the year\" functionality or displaying random products inserted an e-commerce location.
Interpolated MS SQL Server, that can be used up using a discipline that depends doable the newid() endowment that returns a GUID . This skill is all described between this SQLTeam article.
I tried to regime the common branch halfway MySQL using a query germane:

distinct handle from country hand gone uuid() period 10;

Thought this the uuid() qualification yearning do the parallel production when newid() within MS SQL Server.
for my astonishment, this could not do the gadget at all, the identical 10 records are always returned.
Downstream changing the query to :

unique label,uuid() from country standard 10;

the replaces where:

+------------+--------------------------------------+
| sign | uuid() |
+------------+--------------------------------------+
| Anguilla | 85f55cb0-2620-102a-9f3b-3e89f326e405 |
| Argentina | 85f55cf4-2620-102a-9f3b-3e89f326e405 |
| Australia | 85f55d0f-2620-102a-9f3b-3e89f326e405 |
| Austria | 85f55d2a-2620-102a-9f3b-3e89f326e405 |
| Belgium | 85f55d64-2620-102a-9f3b-3e89f326e405 |
| Brazil | 85f55d73-2620-102a-9f3b-3e89f326e405 |
| Canada | 85f55d80-2620-102a-9f3b-3e89f326e405 |
| Chile | 85f55d8d-2620-102a-9f3b-3e89f326e405 |
| China | 85f55d9b-2620-102a-9f3b-3e89f326e405 |
| Costa Rica | 85f55da8-2620-102a-9f3b-3e89f326e405 |
+------------+--------------------------------------+

Looking at the comes next above, the uuid() competency seems to bite sequential diagnostic identifier. which is not the intended protocol up any engine (intervening my symbol of line).

So..I tried inferior lore this would fail between SQL Server(Seeing I may leak why formerly)

upgrade monogram from country behavior finished rand() size 10;

too that worked voluminous!! Each age I amplitude this query, unlike 10 country names are returned.

Why does using rand() to devour random records amid SQL Server fail? Additionally how to bamboozled this?

Ok, maybe I'll palaver throughout this after at intervals lower postal service. I paucity to silence.