Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
R. Averkov 05.07.2005 06:35
Надо глубже вчитываться в короткий текст ошибки: Not unique table/alias :-)SELECT root.forum_id, root.date, IFNULL(children.date,root.date) AS last_dt, IFNULL(users.login,root.author) AS author, IFNULL(last_users.login,children.author) AS last_author, COUNT(children.forum_id) AS cnt FROM forum AS root LEFT JOIN forum AS children ON root.id=children.parent_id LEFT JOIN users ON root.user_id=users.user_id LEFT JOIN users AS last_users ON children.user_id=last_users.user_id WHERE root.parent_id=0 GROUP BY root.forum_id