- 1
- 2
- 3
- 4
- 5
- 6
- 7
query = "select coach_id, "
" concat(coach_surname,' ',coach_name,' ',coach_pname, ' (', (select name from price_coach_types where id_coach_type = coaches.coach_type), ')'), "
"ifnull((select price_single_child from price_coaches where coach_id = coaches.coach_id and price_start_date = " + actual_price+ "),0),"
"ifnull((select price_single_adult from price_coaches where coach_id = coaches.coach_id and price_start_date = " + actual_price+ "),0),"
"ifnull((select price_group_child from price_coaches where coach_id = coaches.coach_id and price_start_date = " + actual_price+ "),0),"
"ifnull((select price_group_adult from price_coaches where coach_id = coaches.coach_id and price_start_date = " + actual_price+ "),0)"
" from coaches order by binary coach_surname, coach_type";