我想比较 2 个表以获取不同的数据。
tb1 tb2
============== ==============
|id| doc_name| |id| doc_summ|
============== ==============
|1 | 01180543| |1 | 01180543|
|2 | Chord | ==============
==============
我想比较doc_name
和doc_summ
。从那个例子中,结果必须是Chord
.
$q = mysql_query(" SELECT t1.doc_name FROM tb1 as t1, tb2 as t2 WHERE t1.doc_name != t2.doc_summ");
while ($row = mysql_fetch_array($q)){
$doc_copy = $row['doc_name'];
}
但结果仍然返回所有数据。怎么了?谢谢你 :)