SELECT `t` . `Type` , `t0` . `Id` , `t0` . `Title` FROM ( SELECT `c` . `Type` FROM `Compliance_AuditAnswer` AS `c` WHERE `c` . `IsActive` AND NOT ( `c` . `IsDeleted` ) GROUP BY `c` . `Type` ) AS `t` LEFT JOIN ( SELECT `c0` . `Id` , `c0` . `Title` , `c0` . `Type` FROM `Compliance_AuditAnswer` AS `c0` WHERE `c0` . `IsActive` AND NOT ( `c0` . `IsDeleted` ) ) AS `t0` ON `t` . `Type` = `t0` . `Type` ORDER BY `t` . `Type` , `t0` . `Id` 