Preprocess data and reuse ?

Results 1 to 2 of 2

Thread: Preprocess data and reuse ?

  1. #1
    Join Date
    Dec 1969

    Default Preprocess data and reuse ?

    Hi,<BR><BR>This is a generic question. Is there any way to retreive data from a database, run further queries on it and then print out all the data.<BR><BR>For example, I retreive some information about &#039;rates&#039; from a database. The first thing I want to do is print out the highest rate and its associated information, and then afterwards print out a list of all the rates - the only way I could do this would be innefficient, to go through all the recordset find the highest rate and print it and then go through all the recordset again to print it out.<BR><BR>Is there a better way ? (e.g. like in object orientated programming I could store an object with all the recordset data, run a function to find the highest rate, and then print out the object - so how could I do this in ASP?).<BR><BR>Thanks,<BR><BR>Hal.

  2. #2
    Join Date
    Dec 1969

    Default RE: Preprocess data and reuse ?

    If you&#039;re using SQL Server the best way to do it would be to do two queries - one to return all the records for printing and one to get the details of the highest rate, like this:<BR><BR>select top 1 * from tblRates order by Rate desc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts