I have two tables as following
table one named tbooking having column fields as booking_ref_id, date_created
table two named tpayment_transaction having column fields as payment_txn_ref_id, booking_ref_id, payment_status
I have to write a query for “Number of transaction per status per year”
the result should be like —
payment_status count date_created
1 Progress 34 2011
2 Completed 10 2012
and so on….
since threre are 4 type of payment_status
I’m assuming tbooking.date_created is some kind of date field. If it’s a string field with the actual year like ‘2011’, then you can exclude the
YEAR()function: