I did some quick googling for you...
|
Andrez Sudol |
|
2/12/2007 12:20:51 AM |
Depending on your table size this might be the simplest solution...
SELECT TOP 5 * FROM some Table ORDER By NEWID()
This generates a newid for every row in the table and then selects th e rows, but if your table isn't mega-huge should work fine.
I'm sure there are other ways bu t like I said...this is the easiest I found.
Post Comments |
|
Re: FROM table ORDER BY RANDOM
|
Haseena Sabir Mohammed |
|
2/12/2007 12:24:39 AM |
It wouldn't have anything to do with ASP, that's a SQL clause.
SELECT * () LIMIT 5
Or if you are unfortunate enough to be using an MS database:
SELECT TOP 5 * FROM table ORDER BY RA NDOM()
Arch: wouldn't that just create the ID# in order, not randomly?
Post Comments |
|
Re: multiple tables connection
|
Haseena Sabir Mohammed |
|
2/12/2007 12:32:36 AM |
Actually...
If your table structure is Identical and you're using a SQL table look into the UNION function.
http://www.w3schools.com/sql/sql_union.asp
Post Comments |
|