比如:cdr表中的CallerId欄位中資料在station表中num不存在的
sql語句
SELECT CallerId
FROM ast_cdr WHERE CallerId NOT IN (SELECT number FROM ast_station)
加上條件 並 CallerId 欄位 去重複
SELECT DISTINCT CallerId FROM ast_cdr WHERE CallerId NOT IN (SELECT number FROM ast_station) and StartTime>='2024-02-01 00:00:00' and EndTime<='2024-02-29 23:59:59' and CallType='outbound'