Fóruns
user warning: Every derived table must have its own alias
query:
SELECT n.title AS topictitle,
r.title AS replytitle,
r.time timestamp,
r.type AS replytype,
n.type AS topictype,
n.nid AS topicid,
t.tid,
r.cid AS cid,
r.uid,
u.name
FROM node AS n
INNER JOIN
(
(SELECT title,
created AS time,
nid,
uid,
type,
'cid' AS cid
FROM node
)
UNION
(SELECT subject,
timestamp,
nid,
uid,
'comment',
cid
FROM comments
WHERE comments.status = 0
)
ORDER BY time DESC
) AS r ON n.nid=r.nid
INNER JOIN term_node AS t ON n.nid = t.nid
INNER JOIN users AS u ON r.uid = u.uid
WHERE n.status = 1
GROUP BY tid; in /htdocs/home/cress-pa/www/includes/database.mysql.inc on line 174.
| Fórum |
Tópicos |
Posts |
Último post |
|
|
|
|
4 |
25 |
n/a |
© 2008 CRESS PA - Todos os Direitos Reservados