SELECT *
FROM A a
LEFT OUTER JOIN B b
ON ((CASE
WHEN LENGTH (a.xxx) = 3
THEN a.xxx
WHEN LENGTH (a.yyy) = 2
THEN TO_CHAR (a.xxx || TRUNC (a.zzz, 'YY'))
END) **=**
(CASE
WHEN LENGTH (a.xxx) = 3 THEN b.wert
WHEN LENGTH (a.xxx) = 2 THEN b.bez
END));
答案 0 :(得分:1)
这是您想要的逻辑吗?
public function index(Request $request) {
Log::info($request->bearerToken());
// ...
}
布尔表达式通常不需要 on (length(a.xxx) = 3 and a.xxx = b.wert) or
(length(a.xxx) = 2 and (a.xxx || TRUNC(a.zzz, 'YY')) = b.bez)
表达式。