Hi I am not so experience with SQL and try to make this query work
select ad.ad_id as the_ad_id
, ad_country.country_id
, v.vertical
from ad
left
join ad_country
on ad.ad_id = ad_country.ad_id
join
( select ad_id
from ad_vertical
where ad_vertical.vertical = 'biz op'
) as v
on ad.ad_id = v.ad_id
limit 10
And I get the error:
Unknown column 'v.vertical' in 'field list
But when I'm the same query with left join without filtering it is working.
select ad.ad_id as the_ad_id
, ad_country.country_id
, v.vertical
from ad
left
join ad_country
on ad.ad_id = ad_country.ad_id
left
join ad_vertical as v
on ad.ad_id = v.ad_id
limit 10
Can you help me figure out what am I doing wrong? Thanks , Or