a | b | |
---|
| 0 | + | SELECT count(*) |
---|
| 0 | + | FROM courses c |
---|
| 0 | + | LEFT JOIN course_methodologies cm |
---|
| 0 | + | ON cm.method_id = c.method_id |
---|
| 0 | + | LEFT JOIN course_status cs |
---|
| 0 | + | ON cs.status_id = c.status_id |
---|
| 0 | + | LEFT JOIN partners p |
---|
| 0 | + | ON p.user_id = c.user_id |
---|
| 0 | + | LEFT JOIN events_schedule esched |
---|
| 0 | + | ON c.course_id = esched.course_id |
---|
| 0 | + | LEFT JOIN currency cur |
---|
| 0 | + | ON cur.currency_id = c.currency_id |
---|
| 0 | + | LEFT JOIN course_categories cc |
---|
| 0 | + | ON cc.course_id = c.course_id |
---|
| 0 | + | LEFT JOIN categories cat |
---|
| 0 | + | ON cat.category_id = cc.category_id |
---|
| 0 | + | LEFT JOIN program_types pt |
---|
| 0 | + | ON pt.program_type_id = c.program_type_id |
---|
| 0 | + | LEFT JOIN countries con |
---|
| 0 | + | ON con.country_id = c.country_id |
---|
| 0 | + | LEFT JOIN provinces ps |
---|
| 0 | + | ON ps.province_id = c.province_id |
---|
| 0 | + | LEFT JOIN states st |
---|
| 0 | + | ON st.state_id = c.state_id |
---|
| 0 | + | LEFT JOIN city cy |
---|
| 0 | + | ON cy.city_id = c.city_id |
---|
| 0 | + | LEFT JOIN partners_individual pi |
---|
| 0 | + | ON pi.user_id = c.user_id |
---|
| 0 | + | LEFT JOIN users u |
---|
| 0 | + | ON u.user_id = c.user_id |
---|
| 0 | + | WHERE 1 = 1 AND c.course_type = 1 AND active = 1 AND c.country_id = 52 |
---|
| 0 | + | AND ((('2010-10-01 00:00:00' <= esched.date_start |
---|
| 0 | + | AND esched.date_start <= '2010-11-04 00:00:00') |
---|
| 0 | + | OR ('2010-10-01 00:00:00' <= esched.date_end |
---|
| 0 | + | AND esched.date_end <= '2010-11-04 00:00:00')) |
---|
| 0 | + | OR ((esched.date_start <= '2010-10-01 00:00:00' |
---|
| 0 | + | AND '2010-10-01 00:00:00' <= esched.date_end) |
---|
| 0 | + | OR (esched.date_start <= '2011-10-04 00:00:00' |
---|
| 0 | + | AND '2010-11-04 00:00:00' <= esched.date_end))) |
---|
... | |
---|