Select Count(*) as iCount , iQueueID , 'Submitted' as cSummaryStatus >from AppQueueStd >Where cStatusDesc='File added to the queue. Ready for processing.' >Group By iQueueID , cTPAID , cSubmittedBy , tCreateDt >Having Count(*)=1>
Select iQueueID , 'Submitted' as cSummaryStatus ; from AppQueueStd ; Where cStatusDesc='File added to the queue. Ready for processing.' ; And iQueueID Not In ( ; Select iQueueID ; from AppQueueStd ; Where cStatusDesc<>'File added to the queue. Ready for processing.' )