Mysql 不在查询中与我的sql中的值不匹配
我的问题是:Mysql 不在查询中与我的sql中的值不匹配,mysql,sql,Mysql,Sql,我的问题是: select * from customer_purchase_order where purchase_id NOT IN (SELECT cus_po_no FROM cus_comercial_invoice) 在此采购标识中,客户商业发票表中的客户采购单号为单值,但客户采购单号为多值 例如: Purchase_id 1: POV162031. Purchase_id 2: POV162125. cus_po_no : 'POV162031','POV162125'.
select * from customer_purchase_order where purchase_id NOT IN (SELECT cus_po_no FROM cus_comercial_invoice)
在此采购标识中,客户商业发票表中的客户采购单号为单值,但客户采购单号为多值
例如:
Purchase_id 1: POV162031.
Purchase_id 2: POV162125.
cus_po_no : 'POV162031','POV162125'.
不在查询中不工作如果要联接外键、主键上的行,请使用
join
select * from customer_purchase_order cpo JOIN
cus_comercial_invoice cci
ON cpo.purchase_id = cci.cus_po_no
您不正确,请看这一点-它按预期工作。是
采购id
和客户订单号
相同类型吗?如果您发布stacktrace,将很容易回答相同类型和相同值。对于ex:a=1和a=2等。如果您的值相同,您将得到空集。如果您得到任何其他错误或异常,请首先向我们提供详细信息执行->从客户商业发票中选择客户订单号
您得到了什么?