I have designed 3 tables in mysql Payments, CreditCardPayment, WireTransfer. Payment table has column payment_mode which store the mode of payment used (credit card or paypal). In CreditCardPayment & WireTransfer I am storing the payment id from payment table.
Now how do I fetch all the payments from payment table with the payment mode (details from either credit card or paypal table)?