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 |
|
oahu9872
Posting Yak Master
112 Posts |
Posted - 2007-03-14 : 21:07:27
|
| I have a column with 20 possible values. I want to run a query that will pull 15 rows for each possibility, for a total of 300 rows. Is there a way to set up a loop to find a value, pull it 15 times, then go onto the next value?Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-15 : 01:35:35
|
| select x.col1, y.numberfrom (select distinct col1 from table1) as xcross join (select number from master..spt_values where name is null and number between 1 and 15) as yorder by x.col1, y.numberPeter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|