即時消息我爲一個廣告系列撰寫查詢,並且每當我嘗試運行它時,我都會收到一個錯誤,指出語法不正確。如何解決「附近的語法錯誤」,「」?
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.email_bounced = 'false'
and opp.email_unsubscribe = 'false'
and opp.first_mkt_medium not in ('partner', 'inbound_outbound')
and opp.latest_mkt_medium not in ('partner', 'inbound_outbound')
and datediff (day, cast(latest_rfq_submitted_date as date), cast(getdate() as date)) > 30
and opp.on_cover = 'no'
and opp.primary_group in ('Market_trader', 'Food_stand', 'Mobile_food_van', 'Caterer')
and opp.site = 'simplybusiness'
and opp.opportunity_status = ('quote_recieved', 'rfq_submitted', 'policy_expired_not_renewed')
) opp
where row_number = 1
刪除一些代碼,重試,刪除一些更多的代碼,重試等 – jarlh
請添加完整的錯誤消息。 –
歡迎來到Stack Overflow!爲了幫助人們回答您的問題,您需要更加具體地瞭解錯誤。請編輯您的帖子,以便將編譯[mcve]時的確切錯誤(最好使用複製+粘貼以避免轉錄錯誤)。 –