Added appn_type to stats sql