Server me right for using <pre>

Try again:-

SELECT 
        a.ClubArmsID, a.ArmsID, a.CalibreID, a.PowderID,
        l1.GListItem AS ArmType, l2.GListOther AS ArmSort,  
        l2.GListItem AS ArmCalibre, 
        l3.GListItem AS ArmPowder
FROM steel_arms a
JOIN
        (SELECT * FROM globallists WHERE GListDeleted = 0 
                AND (GListName = 'Arms' OR 
                        GListName = 'Calibre' OR 
                        GListName = 'Powder')
        UNION
        SELECT * FROM steel_lists WHERE ListDeleted = 0 
                AND (ListName = 'Arms' OR 
                        ListName = 'Calibre' OR 
                        ListName = 'Powder')
        ) l1 
ON l1.GListID = a.ArmsID
JOIN
        (SELECT * FROM globallists WHERE GListDeleted = 0 
                AND (GListName = 'Arms' OR 
                        GListName = 'Calibre' OR 
                        GListName = 'Powder')
        UNION
        SELECT * FROM steel_lists WHERE ListDeleted = 0 
                AND (ListName = 'Arms' OR 
                        ListName = 'Calibre' OR 
                        ListName = 'Powder')
        ) l2 
ON l2.GListID = a.CalibreID
JOIN
        (SELECT * FROM globallists WHERE GListDeleted = 0 
                AND (GListName = 'Arms' OR 
                        GListName = 'Calibre' OR 
                        GListName = 'Powder')
        UNION
        SELECT * FROM steel_lists WHERE ListDeleted = 0 
                AND (ListName = 'Arms' OR 
                        ListName = 'Calibre' OR 
                        ListName = 'Powder')
        ) l3 
ON l3.GListID = a.PowderID
ORDER BY ArmType ASC, ArmSort ASC, ArmCalibre ASC

Reply via email to