本文介绍了为什么以下查询会出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
declare @vc_opportunity_id varchar(100);
set @vc_opportunity_id = '';
declare @in_website_id int;
set @in_website_id = 0;
SELECT a.in_log_id, a.in_website_id, a.vc_opportunity_id, e.Name AS vc_opportunity_name, a.in_client_id, b.in_user_type_id, b.vc_first_name, b.vc_last_name, b.vc_email, d.vc_user_type, c.vc_website_domain_name, a.vc_old_stage_name, a.vc_new_stage_name, a.vc_old_procedure_of_interest__c, a.vc_new_procedure_of_interest__c, a.vc_old_service_of_interest__c,
a.vc_new_service_of_interest__c, CONVERT(VARCHAR(20), a.dt_old_date_of_consultation_c, 101) AS old_consultation_date, CONVERT(VARCHAR(20), a.dt_new_date_of_consultation_c, 101) AS new_consultation_date, a.vc_old_consultation_time_c, a.vc_new_consultation_time_c, CASE WHEN CONVERT(VARCHAR, a.dt_old_appointment_date__c, 101) = '01/01/1900' THEN NULL ELSE CONVERT(VARCHAR, a.dt_old_appointment_date__c, 101) END AS old_appointment_date,
CASE WHEN CONVERT(VARCHAR, a.dt_new_appointment_date__c, 101) = '01/01/1900' THEN NULL ELSE CONVERT(VARCHAR, a.dt_new_appointment_date__c, 101) END AS new_appointment_date, a.vc_old_appointment_window_start__c, a.vc_new_appointment_window_start__c, a.vc_old_appointment_window_end__c, a.vc_new_appointment_window_end__c,
CONVERT(VARCHAR(20), a.dt_log_created, 100) AS log_date FROM dbo.sf_opportunity_client_update_log a
INNER JOIN dbo.website_user b ON a.in_website_id = b.in_website_id AND a.in_user_type_id = b.in_user_type_id
INNER JOIN dbo.website c ON a.in_website_id = c.in_website_id AND c.bt_active = 1
INNER JOIN dbo.common_data_vw_website_user_type d ON a.in_user_type_id = d.in_key
INNER JOIN dbo.sf_opportunity e ON a.vc_opportunity_id = e.Id
WHERE
CASE
WHEN @in_website_id <> 0 THEN a.in_website_id = @in_website_id ELSE a.vc_opportunity_id LIKE @vc_opportunity_id + '%'
END = 1
给予Msg 102,15级,状态1,第15行
''=''附近的语法不正确。在哪里
推荐答案
WHERE
CASE
WHEN @in_website_id <> 0 THEN a.in_website_id = @in_website_id ELSE a.vc_opportunity_id LIKE @vc_opportunity_id + '%'
END = 1
End = 1抛出此错误。删除它,然后重试。
End = 1 is throwing this error. Remove this and try again.
这篇关于为什么以下查询会出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!