Display values from two tables with multiple conditions
This should work:

SELECT table2.course, MIN(table2.date)
  FROM table1 INNER JOIN table2
    ON table1.course = table2.course
  WHERE table2.flag = 1
    AND table2.date &gt; NOW()
  GROUP BY table2.course
  ORDER BY MIN(table2.date)


For your current dataset, you don't even need to JOIN with table1.