日期:2014-05-17  浏览次数:20808 次

帮忙分下SQL 语句哪里出错了,谢谢!
本帖最后由 ggxxkkll 于 2013-09-06 16:25:01 编辑
下面是SQL语句:

SELECT
    CAST(S_TP2_Customer.CUST_NUMBER as Varchar(15)) as Cust,
    S_TP2_Siebel.*,
    S_TP2_CompanyInfo.COMPANY_NUMBER,
    cast(NULLIF(
    otranslate(
      case         
        when position('!' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('@' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('#' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('$' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('%' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('^' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('&' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('*' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('(' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position(')' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('-' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('_' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('+' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('=' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('{' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('[' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('}' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position(']' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('|' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position('\' in S_TP2_CompanyInfo.COMPANY_NUMBER) > 0  then NULL
        when position(':' in&nb