I have sql statement one;
select linkscat.id, linkscat.category
from linkscat, contentlinks, links
where contentlinks.linksid = links.id
and contentlinks.contentid = @contentid
and links.linkscatid = linkscat.id
order by linkscat.category
and sql statement 2 takes a parameter called @linkscat which is ‘id’ from the statement above;
select * from links where linkscatid= @linkscat
I’m running into all types of trouble trying to use many sqldatareaders, nested repeaters etc, but it would be great if all the work could be done in the one statement? Is this possible and if so please can you help by posting the final statement?
Thanks greatly, any help much appreciated!
You are already using joins, so you can simply add the wanted fields to the select clause:
Though I would state only the required fields instead of using
*, and would use explicit joins: