alexbernal0
11/29/2017 - 4:22 PM

Created by SnippLeaf.com

Created by SnippLeaf.com

select distinct ph1.Company
,ph1.URL
,d.date_verified
,ph1.Country as 'Install Country'
,ph1.Region as 'Install Region'
,ph1.Product
,ph1.Vendor
,ph1.signal_score as 'Signal Score'
,ph1.date_last_verified AS 'Date Last Verified'
,ph1.category_parent AS 'Category Parent'
,ph1.Category
,ISNULL(ph1.Attribute, '') AS 'Category Tags'
,ph1.revenue_range AS 'Revenue'
,ph1.employees_range AS 'Employees'
,ph1.top_level_industry AS 'Top Level Industry'
,ph1.sub_level_industry AS 'Sub Level Industry'
, ISNULL(ph1.hq_address, '') as 'HQ Address'
, ISNULL(ph1.hq_city, '') as 'HQ City'
, ISNULL(ph1.hq_state, '') as 'HQ State'
, ISNULL(ph1.hq_zip, '') as 'HQ Zip'
, ISNULL(ph1.hq_country, '') as 'HQ Country'
, ISNULL(ph1.hq_phone, '') as 'HQ Phone'
from fulfillment.dbo.ph_url_country_all ph1
join fulfillment.dbo.ph_url_country_all ph2 on ph1.url = ph2.url
join fulfillment.dbo.product_hit_url_country_date d on ph1.static_id = d.url_country_id
where ph1.region  = 'EMEA'
and ph1.iso = ph2.iso
and ph1.category_id = 30
and ph2.category_id = 30
and ph1.vendor != ph2.vendor
order by ph1.URL, ph1.country, ph1.vendor, ph1.product