Damian Adrian wrote:
> While using the FTS5 highlight() function in a group by query like this one:
>
> SELECT
>     group_concat(highlight(entries, 1, '>', '<'))
> FROM entries
> WHERE entries MATCH 'an*'
> GROUP BY id;
>
> I get "Error: unable to use function highlight in the requested context".
>
> I have tried various sub-query combinations with the same result;

Because SQLite does subquery flattening and ends up with the same query.

Try this:

SELECT group_concat(details)
FROM (
    SELECT
        id,
        highlight(entries, 1, '>', '<') as details
    FROM entries
    WHERE entries MATCH 'an*'
    LIMIT -1 OFFSET 0        -- rule 14 of 
https://www.sqlite.org/optoverview.html#subquery_flattening
)
GROUP BY id;


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to