我在 MySQL DB PHPMyAdmin 中有两个表:
Table-1: T1
Table-2: T2
我需要编写一个 mysql 查询,它将返回所有 IMEIT1
中未列出的T2
.
例如,在这种情况下查询应该返回123456781235176
。
谢谢。
我在 MySQL DB PHPMyAdmin 中有两个表:
Table-1: T1
Table-2: T2
我需要编写一个 mysql 查询,它将返回所有 IMEIT1
中未列出的T2
.
例如,在这种情况下查询应该返回123456781235176
。
谢谢。
试试这个 select IMEI from T1 where IMEI not in (select IMEI from T2);
SELECT t1.* FRO table1 AS t1
LEFT JOIN table2 AS t2 ON t1.IMEI = t2.IMEI
WHERE t2.IMEI IS NULL
试试这个查询
Select EMEI from t1 where EMEI not in (select EMEI from t2)
select IMEI from T1 where IMEI not in
(
select a.IMEI from T1 as a inner join T2 as b on a.IMEI = b.IMEI
) as exp
希望对你有帮助
SELECT IMEI FROM T1 WHERE IMEI NOT IN(SELECT IMEI FROM T2);