I have a query that returns a list of Advertisers, each Advertisers has several Brands attached to it.
So I'm running this:
select distinct Name from tblAdvertiser
inner join tblAvertiserBrand on AdvertiserID=ID
So this would return a list of Advertisers and I'm trying to write a query that would loop for each row of the list that the query above would give in an automatic manner, any ideas?
SQL 'loops' by default
SELECT *
FROM TABLE WHERE advertiser_name IN
(SELECT DISTINCT Name
FROM tblAdvertiser
INNER JOIN tblAvertiserBrand ON AdvertiserID=ID)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With