Simplify the sql to only show one lot of sql