HiI have this query that query some columns an a xml column. I need to group the output based on the number of rows that have the same country value. Can someone help me out here?SELECT t.u.value('(country/text())[1]', 'nvarchar(30)') as [country] ,t.u.value('(address/text())[1]', 'nvarchar(30)') as [address],tbl.DateAdded, ISNULL(tbl.BID, 0) AS BID, tbl.ID AS PID, tbl.DateDeliveredFROM tbl_FBook tblCROSS APPLY XmlData.nodes('/order/card')t(u) WHERE (tbl.DateAdded BETWEEN CONVERT(DATETIME, '2008-05-20', 102) AND CONVERT(DATETIME, '2009-05-28', 102))