-1

我对这样的 SQL 语句有疑问

SELECT e.id, e.name, d.name as department_id

FROM (FROM (SELECT id, name, department_id
            FROM employee
            WHERE address = 'Texas' ) e
     JOIN department d
     ON e.department_id = d.id )

WHERE CONTAINS( (e.name, d.name), 'user_input_for_search')

执行 SQL 时,我收到错误消息:“不支持功能:全文搜索功能不支持子查询中的列”

有人可以教我如何解决吗?

谢谢

4

2 回答 2

0

我不是 100% 肯定,但我会试一试:)。

子查询有原因吗?除非我遗漏了什么,否则它看起来并不需要。这不应该工作正常吗...?

SELECT e.id, e.name, d.name as department_id
FROM employee e JOIN department d ON e.department_id = d.id
WHERE e.address = 'Texas' AND CONTAINS((e.name, d.name), 'user_input_for_search')
于 2016-07-15T21:16:26.510 回答
0
/********* Begin Procedure Script ************/ 
VENNAMEFUZZ DECIMAL;

BEGIN 

VENNAMEFUZZ = 0.8;
------ SELECTION PRO  -----------------------------------
    LT_1 = 

        SELECT DISTINCT
        "AK"."LIFNR" AS VENDORNUMB,
        "EC"."NAME1" AS VENDORNAME

       FROM
        "BSAK" AS "AK"

        LEFT OUTER JOIN
        "BSEC" AS "EC"

        ON
          "AK"."BUKRS" = "EC"."BUKRS" AND 
          "AK"."BELNR" = "EC"."BELNR" AND
          "AK"."GJAHR" = "EC"."GJAHR" AND
          "AK"."BUZEI" = "EC"."BUZEI"

        WHERE
        "AK"."MANDT" = SESSION_CONTEXT('CLIENT') AND
        "AK"."LIFNR" LIKE '0011%' AND
        "AK"."BSCHL" IN ('31', '32', '34' , '21', '22' , '24' ) AND
        "AK"."BUKRS" = 'RO01' AND
        "AK"."BLDAT" >= '20160801'
        AND "AK"."BLDAT" <= '20160808';   

LT_5= 

    SELECT DISTINCT
    "IT"."VENDORNUMB" AS VENDORNUMB,
    "IT"."VENDORNAME" AS VENDORNAME 

    FROM 
    :LT_1 AS "IT";

IT_1 = 

    SELECT DISTINCT
    "AK"."LIFNR" AS VENDORNUMB,
    "EC"."NAME1" AS VENDORNAME

    FROM
        "BSAK" AS "AK"

    LEFT OUTER JOIN
        "BSEC" AS "EC"

    ON
      "AK"."BUKRS" = "EC"."BUKRS" AND 
      "AK"."BELNR" = "EC"."BELNR" AND
      "AK"."GJAHR" = "EC"."GJAHR" AND
      "AK"."BUZEI" = "EC"."BUZEI"

    WHERE
        "AK"."MANDT" = SESSION_CONTEXT('CLIENT') AND
        "AK"."LIFNR" LIKE '0011%' AND
        "AK"."BSCHL" IN ('31', '32', '34' , '21', '22' , '24' ) AND
        "AK"."BUKRS" = 'RO01';      

----SETTING CURSOR

BEGIN
DECLARE CURSOR c_WS FOR SELECT * FROM :LT_5;
FOR WS_row AS c_WS() DO

VAR_OUT= 

SELECT * FROM :VAR_OUT

UNION ALL(
SELECT
WS_ROW.VENDORNUMB,
VENDORNAME

FROM
:IT_1

WHERE
 CONTAINS(VENDORNAME,WS_ROW.VENDORNAME , FUZZY(:VENNAMEFUZZ)));
END FOR;
END ; 

Please help as I am facing the same error in above code.
于 2017-07-21T11:43:17.473 回答