Re: How to do in one SELECT... and now for Performance

2005-08-01 Thread SGreen
René Fournier <[EMAIL PROTECTED]> wrote on 07/30/2005 02:10:02 AM: > Thanks, this is very helpful. I'm finally starting to understand > Joins. But now I have a serious performance problem. Using INNER JOIN... > > SELECT users.*, COUNT(history.user_id) as num_events > FROM users > INNER JOIN hist

Re: How to do in one SELECT... and now for Performance

2005-07-29 Thread René Fournier
Thanks, this is very helpful. I'm finally starting to understand Joins. But now I have a serious performance problem. Using INNER JOIN... SELECT users.*, COUNT(history.user_id) as num_events FROM users INNER JOIN history ON (users.id = history.user_id) GROUP BY users.user_name ORDER BY id DESC