[英]How to compare condition multile table in mysql query?
how can i compare multiple table while checking condition in MySQL? 如何在MySQL中检查条件时比较多个表?
Cheque Table1 检查表1
--------------------------
date | Cheque_no
--------------------------
10/10/2015 | 09876543
--------------------------
17/10/2015 | 45678990
--------------------------
Payment Table2 付款表 2
----------------------------------------
date | Cheque_no | Amount_Paid
----------------------------------------
10/10/2015 | 09876543 | 1000
----------------------------------------
And I am using the following query: 我正在使用以下查询:
select * from Cheque,Payment where Cheque.Cheque_no != Payment .Cheque_no
I am Expecting the output is 我期待输出是
17/10/2015 | 45678990
Seems like a simple not in
condition would do the trick: 看起来像一个简单的
not in
条件下会做的伎俩:
SELECT *
FROM cheque
WHERE cheque_no NOT IN (SELECT cheque_no FROM payment)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.