0

我在 MySQL DB PHPMyAdmin 中有两个表:

Table-1: T1

在此处输入图像描述

Table-2: T2

在此处输入图像描述

我需要编写一个 mysql 查询,它将返回所有 IMEIT1中未列出的T2.

例如,在这种情况下查询应该返回123456781235176

谢谢。

4

5 回答 5

1

试试这个 select IMEI from T1 where IMEI not in (select IMEI from T2);

于 2013-04-09T10:03:04.317 回答
0
SELECT t1.* FRO table1 AS t1
LEFT JOIN table2 AS t2 ON t1.IMEI = t2.IMEI
WHERE t2.IMEI IS NULL
于 2013-04-09T10:02:39.853 回答
0

试试这个查询

Select EMEI from t1 where EMEI not in (select EMEI from t2)
于 2013-04-09T10:02:49.480 回答
0
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

希望对你有帮助

于 2013-04-09T10:03:18.077 回答
0
SELECT IMEI FROM T1 WHERE IMEI NOT IN(SELECT IMEI FROM T2);
于 2013-04-09T10:03:24.920 回答