InterSystem Cache Where子句

时间:2018-03-16 20:47:43

标签: sql caching odbc intersystems

我有一个Web应用程序,我在那里查询InterSystemsCachè数据库。查询是:

SELECT TOP 10 "x_med_orders"."bnf_chapter","x_active_inpatients"."ward","x_active_inpatients"."lnkpid", "x_med_orders"."drug_description", "x_med_orders"."start_date", "x_med_orders"."discontinue_date", "x_med_orders"."stop_date" FROM  ( "XXX_Super"."x_active_inpatients" "x_active_inpatients" INNER JOIN "XXX_Super"."x_med_orders" "x_med_orders" ON "x_active_inpatients"."lnkpid"="x_med_orders"."lnkpid")WHERE = "x_med_orders"."bnf_chapter" = 'xxx'

当我删除where子句时,查询运行完全正常。如果我包含它,我会得到以下错误。这是我第一次处理这种数据库类型。

error image

2 个答案:

答案 0 :(得分:0)

之后

缺少空格)

  SELECT TOP 10 "x_med_orders"."bnf_chapter"
        ,"x_active_inpatients"."ward"
        ,"x_active_inpatients"."lnkpid"
        , "x_med_orders"."drug_description"
        , "x_med_orders"."start_date"
        , "x_med_orders"."discontinue_date"
        , "x_med_orders"."stop_date" 
  FROM   "XXX_Super"."x_active_inpatients" "x_active_inpatients" 
  INNER JOIN "XXX_Super"."x_med_orders" "x_med_orders" ON "x_active_inpatients"."lnkpid"="x_med_orders"."lnkpid"
  WHERE = "x_med_orders"."bnf_chapter" = 'xxx

和()在掩盖内连接的错误位置

答案 1 :(得分:0)

所以如果这对其他人有帮助,那么问题就是我必须在where子句中使用%EXACT函数:

WHERE(“x_med_orders”。“bnf_chapter”)='xxx'