So, I'm making a join for mysql to filter out some bad data and I run into this weird issue.
- Both tables are connected by
payment_transaction_id
. - They both have the value
3463
. - A joined result returns no rows.
- Both tables have this value.
Proof that the record is in card_transaction_log:
select count(*)
from card_transaction_log
where payment_transaction_id = 3463;
>> 1
Proof that the record is in transaction:
select count(*)
from transaction
where payment_transaction_id = 3463;
>> 1
But the join doesn't work.
select count(*)
from card_transaction_log a, transaction b
where a.payment_transaction_id = b.payment_transaction_id
and a.payment_transaction_id = 3463;
>> 0
Honestly, I've never seen anything like this before in mysql. I even checked with my colleague to make sure that I wasn't going crazy and/or dumb.
UPDATE:
While this is the same as above, this query doesn't work either:
select count(*)
from card_transaction_log a
join transaction b
on a.payment_transaction_id = b.payment_transaction_id
where a.payment_transaction_id = 3463;
>> 0