我有以下 SQL 查询:
SELECT call_type FROM INCOMING_CALLS, LIVE_CALLS
WHERE LIVE_CALLS.status='INCALL' and INCOMING_CALLS.callerid = LIVE_CALLS.callerid
AND pbl_id in ('111','190','121','111','-','111','121','303','6730','-');
LIVE_CALLS 和 INCOMING_CALLS 这两个表都有 pbl_id 列。这显然会导致以下错误:
ERROR 1052 (23000): Column 'pbl_id' in where clause is ambiguous
我知道通过更改来解决这个问题非常简单
pbl_id in (
至
INCOMING_CALLS.pbl_id in (
和
INCOMING_CALLS.pbl_id in (
但我不能这样做,因为下面的部分是动态构建的,我无法控制它。
AND pbl_id in ('111','190','121','111','-','111','121','303','6730','-');
我需要匹配两个表的 pbl_id。任何提示我该如何实现?