我有2个表MySQL的逆选择的结果我想找到的不匹配的结果:从2个表
table1
REF CARD AMOUNT
12345 55432 1000
23456 55321 2000
34567 55789 3000
table2
MSG AMT ID
12345_T1R3-55432 1000 456
23456-R1M5-55321 2000 567
34567*[email protected] 5000 783
我的查询:
SELECT
'table1'.'REFF',
'table2'.'MSG',
'table1'.'card',
'table1'.`amount`,
'table2'.'amt'
FROM
'table1',
'table2'
WHERE
'table2'.'MSG' LIKE CONCAT('%', 'table1'.'REFF', '%') AND 'table2'.'MSG' LIKE CONCAT('%', 'table1'.'card', '%')
查询结果
table1.reff table2.msg table1.card table1.amount table2.amt
12345 12345_T1R3-55432 55432 1000 1000
23456 23456-R1M5-55321 55321 2000 2000
我想从这个结果得到其他结果(反相),如:
table1.reff table2.msg table1.card table1.amount table2.amt
34567 34567*[email protected] 55789 3000 5000
谢谢
您对单引号的使用完全不正确。 –
我正在使用MySQL Front,并且该应用程序自动给出了引号 – Andy
请参阅https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-我要非常简单的sql查询 – Strawberry