I have 2 tables in mariadb which are treatments and payments.
Treatments: id(int(11)), treatment_name(varchar(255)), treatment_date(date)
Payments: id(int(11)), treatment_id(int(11)), payment_amount(decimal(10,2)), payment_date(date)
I want to list records from both table for a given date range, for example from 2016-01-01 to 2016-06-06
1-If the treatment is in between the given date range and has payment OR 2-if the treatment isn't in between the date range BUT has payment with the payment date is in between the given date range.
Anyone can help me for setting the query?