Hi,
I have this query:
SELECT COUNT(*) FROM transaction_table
WHERE RESPONSE=‘0’ AND DATEDIFF(CURDATE(), TRANSACTION_DATE) <= 3
AND PAN_ENCRYPTED=
(
SELECT PAN_ENCRYPTED FROM transaction_table
WHERE TRANSACTION_ID=‘580’ AND RESPONSE=‘0’
)
My db is a InnoDb and i use mysql 5.
How to improve the speed of my query?
It’s better to use ROW_COUNT and not COUNT(*) ?
It’s better make two distinct queries or a subselect?
Thank you
Andrea