I have a web application where I am querying an InterSystems Cachè database. The query is:
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'
When I remove the where clause, the query runs perfectly fine. If I however include it I get the error below. This is my first time dealing with this database type.