UmwandelnPhp

PHP-Programmierer chatten hier
Anonymous
 Umwandeln

Post by Anonymous »

Code: Select all

SELECT *, SUM(tbl.relevance) AS relevance FROM
(
(
SELECT q_id,
MATCH(a_content) AGAINST ('бутон') AS relevance
FROM answers

WHERE
MATCH(a_content) AGAINST ('бутон')
)
UNION
(
SELECT q_id,
(MATCH(q_content) AGAINST ('бутон')) * 1.5 AS relevance
FROM questions

WHERE
MATCH(q_content) AGAINST ('бутон')
)
) AS tbl

JOIN questions ON questions.q_id = tbl.q_id

GROUP BY tbl.q_id
ORDER BY relevance DESC

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post