Let me explain what happens in Korma when you're executing the given select query. There was no information about the type of relations between groups and subtopics, and subtopics and articles, but I think it is safe to assume that they are has-many relations.
1. Korma selects groups with given gid (select * from groups where gid = ?)
2. For each row (group) in the result set, Korma selects subtopics related to it (select * from subtopic where group_id = ?)
3. For each row in subtopic result set, Korma selecte articles related to it (select * from articles where subtopic_id = ?)
So as you can see, there's no single sql statement that could be returned `as-sql` function, but three different sql statements and they will be executed zero to n times depending on the result count and how lazy sequences are realised.
You could also use `join` instead of `with` in your query (results in single sql statement) but it looks like it cannot be nested in this way.