|
Are you asking if you read in the list from your first query, and then fire off an individual query for each result row? Maybe instead, you can make a list of the ID values to look for, and use where id in ( 1, 2, 3, ... ) instead of nesting? That will be a more scalable approach, making less round trips to the database.
On that note, to get the number of comments, I'd do that with your asp code rather than sending down another query along the lines of select count(*) from x where id in ( 1, 2, 3, ... ).
|