sql server stock quote every second <p>I have a table with stock quotes</p> <p>Symbol<br/> Ask<br/> Bid<br/> QuoteDateTime</p> <p>Using SQL Server 2008, lets say for any given 60 second time period I want to select quotes on all symbols so that there is a record for every second in that time period. </p> <p>Problem is not every symbol has the same number of quotes - so there are some seconds that have no quote record for any given symbol. So I want to fill in the missing holes of data. So if ORCL has quotes at second 1, 2, 3, 5, 7, I want the result set that has 1,2,3,4,5,6,7...up to 60 sec (covering the whole minute). The values in row 4 come from row 3</p> <p>In this scenario I would want to select the previous quote and use that for that particular second. So there is continuous records for each symbol and the same number of records are selected for each symbol.</p> <p>I am not sure what this is called in sql server but any help building a query to do this would be great</p> <p>For output I am expecting that for any given 60 sec time period. For those symbols that have a record in the 60 seconds, there will be 60 records for each symbol, one for each second</p> <p>Symbol Ask Bid QuoteDateTime</p> <p>MSFT 26.00 27.00 2010-05-20 06:28:00<br/> MSFT 26.01 27.02 2010-05-20 06:28:01<br/> ...<br/> ORCL 26.00 27.00 2010-05-20 06:28:00<br/> ORCL 26.01 27.02 2010-05-20 06:28:01<br/></p> <p>etc</p>