전자 메일에 대한 고객 데이터를 가져 오기위한 쿼리를 작성하려고합니다. 이 쿼리입니다 :이 구문 오류는 어떻게 해결할 수 있습니까?
select
opp.*
from
(
select
opp.*,
row_number() over (partition by opp.contact_email_address order by opp.status_date desc) as row_number
from
opportunity_data opp
where
opp.site = 'wesellinsurance'
and opp.email_bounced = 'false'
and opp.email_unsubscribed = 'false'
and opp.first_mkt_medium not in ('partner', 'inbound_outbound')
and opp.latest_mkt_medium not in ('partner','inbound_outbound')
and opp.on_cover = 'false'
and opp.primary_group in ('market_trader', 'food_stand', 'mobile_food_van', 'caterer')
and opp.opportunity_status = ('quote_recieved','rfq_submitted', 'policy_expired_not_renewed')
and datediff(day, cast(latest_rfq_submitted_date as date),cast(getdate() as date)) > 30
and opp.lifecycle = 'new_business'
) opp
where row_number = 1
대부분의 구문 분석기가 라인 7에서 문제를 프로그래머라고하지만 난 볼 것 캔트 그것을
다음과 같은 SQL Server 구문을 사용하고 있습니다. MySQL 태그. 데이터베이스를 전환하는 것이 좋습니다. –
오류 메시지가 무엇입니까? – Viki888
어떤 종류의 오류가 있었는지 말씀해 주시겠습니까 – mansi