Так же нужна помощь по запросу:
[sql]SELECT
portal_news_cat.category_name as cat, portal_news.title_news,portal_news.author_id, portal_news.text, DATE_FORMAT(portal_news.date, '%e.%m.%Y %H:%i:%s') AS fdate, count(portal_comm.newsid) as numcomm
FROM
portal_news, portal_comm, portal_news_cat
WHERE
portal_news.id=portal_comm.newsid
GROUP BY
portal_news.id
ORDER BY
portal_news.sticked desc, portal_news.date desc
[/sql]
надо добавить:
подсчёт уникальных комментаторов (author_id) из таблицы portal_comm к каждой новости... (у самого не получается...) помогите?
-~{}~ 09.09.04 01:48:
Всё, справился сам. извиняйте:
[sql] SELECT
portal_news.id, portal_news.sticked, portal_news_cat.category_name as cat,portal_news.title_news,portal_news.author_id,portal_news.text,DATE_FORMAT(portal_news.date, '%e.%m.%Y %H:%i:%s') AS fdate, count(portal_comm.newsid) as numcomm, count(DISTINCT portal_comm.author_id) as ppl
FROM
portal_news, portal_comm, portal_news_cat
WHERE
portal_news.id=portal_comm.newsid
GROUP BY
portal_news.id
ORDER BY
portal_news.sticked desc, portal_news.date desc
LIMIT
$offset, $newsperpage
[/sql]
Будут поправки?