Try to enumerate the different fields changing that * (the star) > select *,MAX(a.teaching_date) as max, MIN(a.teaching_date) as min from teaching a, topic_cat b where a.teaching_topic = b.topic_id or a.teaching_topic = 999 group by a.teaching_topic order by a.teaching_date DESC
2007/11/8, mysqlman <[EMAIL PROTECTED]>: > > > I am attempting to get a simple query working: > > select *,MAX(a.teaching_date) as max, MIN(a.teaching_date) as min from > teaching a, topic_cat b where a.teaching_topic = b.topic_id or > a.teaching_topic = 999 group by a.teaching_topic order by a.teaching_date > DESC > > This all works, except I don't want to 'group by a.teaching_topic' if > a.teaching_topic = 999. > > Anyone know how to do this? Thank you. > -- > View this message in context: > http://www.nabble.com/Group-By-and-IF-statement-tf4768518.html#a13639835 > Sent from the MySQL - General mailing list archive at Nabble.com. > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > -- Yaya SIRIMA Formateur - Database Developer +226 76868436 [EMAIL PROTECTED]