Wie kann ich dieses SQL in CodeIgniters Active Records umschreiben?

<code>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
</code>

Antworten auf die Frage(3)

Ihre Antwort auf die Frage