select 
	/* Key bit to save NULL from being the TOTAL field alias */
	IsNull(item.name, 'Total Items') as ItemType, 
    
    count(distinct item.identifier) as Requests FROM tracking INNER JOIN orders
	on tracking.orderID = orders.id INNER JOIN types on tracking.acc=types.acc
	where orders.id=1011
	and tracking.dateordered >= '20130601' and tracking.dateordered <= '20130801'
	
    /* Group by with the rollup option - and because we had the IsNull check above, the rollup total with be named 'Total Items' instead of NULL */
    group by item.name with rollup
    
    /* Optional XML results if required */
	for xml path('entity'), root('items')