I figured it out!

For benefit of all I'm posting the answer:

select top 3 * from table

This query will return the top three rows of the table but now I want to
them to be random.

Once again, in MySQL you could just say "order by rand()" but that doesn't
work in MSSQL.  Does anyone know how to do this?

Dean

----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 16, 2002 2:54 AM
Subject: Re: [PHP] Is there an MSSQL limit function?


> On Saturday 16 February 2002 17:48, Dean Householder wrote:
> > Is anyone familiar with how exactly to use the TOP command in MSSQL?  Is
it
> > in it's own SQL query or built into the select query?  I'm looking at
the
> > help and it doesn't seem very helpful...
>
> It's been a while since I last used MS dbs. But I think it goes something
> like:
>
>
> SELECT * FROM table TOP 5;
>
>
> In fact I checked the help of Access and it is detailed there.
>
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
> /*
> The primary requisite for any new tax law is for it to exempt enough
> voters to win the next election.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to