SC#QCADOOMES-1615 Added sql for production counting.