--- Revision 633861316565 +++ Revision 396231643461 @@ -1,4 +1,57 @@ -SELECT count(*) +SELECT c.course_id, + c.course_reference_no, + c.course_title, + c.currency_id, + c.cost, + c.program_type_id, + c.method_id, + c.status_id, + c.no_of_days, + c.total_hours, + c.no_of_participants, + c.no_of_batches, + c.deadline_for_enrollment, + c.course_description, + c.course_details, + c.trainers_name, + c.venue, + c.room_no, + c.address, + c.city_id, + c.province_id, + c.state_id, + c.country_id, + c.zipcode, + c.contact_details, + c.partner_id, + c.date_added, + c.date_modified, + c.date_deleted, + c.batch_date_required, + c.credits, + c.active, + c.cost_vat_included, + c.cost_not_specified, + c.expiration_date, + c.special_offer, + c.individual_id, + con.country_name, + pt.program_type_name, + cs.status_name, + cs.status_description, + cm.method_name, + cm.method_description, + p.company_aka, + cur.name, + cat.category_name, + ps.province_name, + st.state_name, + cy.city_name, + p.partner_name, + pi.lastname, + pi.firstname, + CONCAT(CONCAT(pi.lastname, ' , '), pi.firstname) AS fullname, + esched.* FROM courses c LEFT JOIN course_methodologies cm ON cm.method_id = c.method_id @@ -28,12 +81,20 @@ ON pi.user_id = c.user_id LEFT JOIN users u ON u.user_id = c.user_id - WHERE 1 = 1 AND c.course_type = 1 AND active = 1 AND c.country_id = 52 - AND ((('2010-10-01 00:00:00' <= esched.date_start - AND esched.date_start <= '2010-11-04 00:00:00') - OR ('2010-10-01 00:00:00' <= esched.date_end - AND esched.date_end <= '2010-11-04 00:00:00')) - OR ((esched.date_start <= '2010-10-01 00:00:00' - AND '2010-10-01 00:00:00' <= esched.date_end) - OR (esched.date_start <= '2011-10-04 00:00:00' - AND '2010-11-04 00:00:00' <= esched.date_end))) + WHERE 1 = 1 + AND c.course_type = 1 + AND active = 1 + AND c.country_id = 52 + AND c.course_title LIKE '%cook%' + AND cat.main_category_id = 40 + AND cat.category_id = 360 + AND ((('2010-09-01 00:00:00' <= esched.date_start + AND esched.date_start <= '2010-09-25 00:00:00') + OR ('2010-09-01 00:00:00' <= esched.date_end + AND esched.date_end <= '2010-09-25 00:00:00')) + OR ((esched.date_start <= '2010-09-01 00:00:00' + AND '2010-09-01 00:00:00' <= esched.date_end) + OR (esched.date_start <= '2010-09-25 00:00:00' + AND '2010-09-25 00:00:00' <= esched.date_end))) +GROUP BY c.course_id +ORDER BY c.course_id DESC