Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
MattieBala69
Starting Member
30 Posts |
Posted - 2005-04-21 : 13:14:19
|
Hey , I need to pick randomly 265 rows of data from a table . If some one could help me out would be great. I am new to Access.Thank you,Mattie |
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
|
MattieBala69
Starting Member
30 Posts |
Posted - 2005-04-21 : 13:19:54
|
I am sorry i did not realize we had Access. thats why i posted there at first and Brett told me that we have Access. Thats why i posted it here. |
 |
|
JimL
SQL Slinging Yak Ranger
1537 Posts |
Posted - 2005-04-21 : 13:24:28
|
He also asked you a question. quote: OK< what's the syntax...help doesn't say how
JimUsers <> Logic |
 |
|
bferriter
Starting Member
34 Posts |
Posted - 2005-04-21 : 13:46:02
|
do you want to select the top of a table randomly, or random records all over the table? |
 |
|
MattieBala69
Starting Member
30 Posts |
Posted - 2005-04-21 : 15:11:17
|
Random records all over the table pleasethis was the query i got from my boss. SELECT [Corrsep Del to select and add to stat sample Revision I].Channel, [Corrsep Del to select and add to stat sample Revision I].Delegated, [Corrsep Del to select and add to stat sample Revision I].ProductCode, [Corrsep Del to select and add to stat sample Revision I].LoanNumber, [Corrsep Del to select and add to stat sample Revision I].[Select]FROM [Corrsep Del to select and add to stat sample Revision I]GROUP BY [Corrsep Del to select and add to stat sample Revision I].Channel, [Corrsep Del to select and add to stat sample Revision I].Delegated, [Corrsep Del to select and add to stat sample Revision I].ProductCode, [Corrsep Del to select and add to stat sample Revision I].LoanNumber, [Corrsep Del to select and add to stat sample Revision I].[Select]HAVING ((([Corrsep Del to select and add to stat sample Revision I].Channel)="c") AND (([Corrsep Del to select and add to stat sample Revision I].Delegated)=1)); |
 |
|
bferriter
Starting Member
34 Posts |
Posted - 2005-04-21 : 15:25:25
|
quickest way i can think of is to create a side table and pull 1 record at a time, 265 times, using a random number as your seed for selection.. if you were coding back end, use a loop with a counter and re-generate a random number each time you select a record, then insert that record to a temp table. that will generate the random selection... |
 |
|
MattieBala69
Starting Member
30 Posts |
Posted - 2005-04-21 : 16:28:06
|
thank you i will try that. |
 |
|
|
|
|
|
|