For now i use a too-long SQL query for that, but will probably replace it with a view. I have to check that it is correct before i do so, however.