Preview:
SELECT
    AVG(Max_equation_number) AS avg_equation_number,
    tbl_categories_id
FROM
    (
    SELECT
        *,
        MAX(equation_number) AS Max_equation_number
    FROM tbl_risk_bia_relationship where tbl_risk_assessment_id=3106 GROUP BY name,tbl_categories_id 
    ORDER BY
    tbl_categories_id ASC
        
    ) as AssetRegisterCategortyAVG
    
    where tbl_risk_assessment_id=3106
    
    GROUP BY
    tbl_categories_id

    ;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter