my ISP is using mysql v4.0.26 I am trying to do the following SQL and cannot get it to parse without an #1064 error.
select r.prog_id, r.prog_name, p.show_id, p.show_title, p.show_desc, p.show_speaker, p.show_date_recorded, s.spk_name from programmes p, series r, speaker s where r.prog_id = p.show_prog_id and p.show_speaker = s.spk_id and r.prog_id <> 5 and p.show_date_recorded between '2006-08-25' and '2006-09-22' and p.show_date_recorded = (select max(show_date_recorded) from programmes q where q.show_id = p.show_id) Tables are joined as shown by first two where statements; r has 6 unique series, p has multiple programmes and s has multiple speakers I'm trying to pick out the latest programme in each series in a date range and include the series full name (prog_name) and speaker full name (spk_name) from the other tables. I've played around with joins but cannot seem to get round it, Any suggestions apart from ISP using different mySQL greatly appreciated! Rob ----------------------------------------- Email sent from www.ntlworld.com Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]