How to get the next 1,000,000 records
-
Hi, I have a table with 2,000,000 records and there is no way for me to filter it by range. I was able to get the first 1,000,000, my problem is to get the next 1,000,000 without any duplicates from the first 1M records. Any Idea. SELECT TOP 1000000 * from Table1 how about the next 1M?? Pls..
Dabsukol
-
Hi, I have a table with 2,000,000 records and there is no way for me to filter it by range. I was able to get the first 1,000,000, my problem is to get the next 1,000,000 without any duplicates from the first 1M records. Any Idea. SELECT TOP 1000000 * from Table1 how about the next 1M?? Pls..
Dabsukol
Select top 1000000 colname from ( Select top 2000000 colname from urtable order by colname desc ) T order by colname asc
G. Satish
-
Select top 1000000 colname from ( Select top 2000000 colname from urtable order by colname desc ) T order by colname asc
G. Satish
In short For First 1000000 Select top 1000000 colname from urtable order by colname ASC For Next 1000000 Select top 1000000 colname from urtable order by colname DESC
ZAK
-
In short For First 1000000 Select top 1000000 colname from urtable order by colname ASC For Next 1000000 Select top 1000000 colname from urtable order by colname DESC
ZAK
Oops just added another record - this is a Microsoft answer, technically correct practically useless.
Never underestimate the power of human stupidity RAH
-
Hi, I have a table with 2,000,000 records and there is no way for me to filter it by range. I was able to get the first 1,000,000, my problem is to get the next 1,000,000 without any duplicates from the first 1M records. Any Idea. SELECT TOP 1000000 * from Table1 how about the next 1M?? Pls..
Dabsukol
Select top 1m records order by ID Get the last ID in the first set (you do have an ID field) Select the top 1m records where ID > last ID You can also look into Row_Number in SQL Server, this will eliminate the detect requirement but is more complex in the select. I would assume you are processing the 1m records and therefore detecting the last ID would be trivial.
Never underestimate the power of human stupidity RAH