Selecting attributes corresponding to the most frequent entries in a junction table
Observe that this expression is almost repeated:


SELECT a_field, COUNT(a_field) AS amount
    FROM JunctionTable
    GROUP BY a_field



That is an indication that you could use a Common Table Expression.  Given the limited information I have about your situation, I would call it JunctionCount.  I would rename amount, which is ambiguous, to occurrences.

To obtain all junctions that have the maximal number of occurrences, you can use the RANK() window function.

WITH JunctionCount AS (
    SELECT a_field, COUNT(*) AS occurrences
        FROM JunctionTable
        GROUP BY a_field
), MostJunctions AS (
    SELECT a_field, RANK() OVER (ORDER BY occurrences DESC) AS occurrence_rank
        FROM JunctionCount
) SELECT b_field
    FROM MyTable
        INNER JOIN MostJunctions
            ON MyTable.a_field = MostJunctions.a_field
    WHERE MostJunctions.occurrence_rank = 1;