Pls tell any alternate query for this,
SELECTtop2 EventTitle,STUFF(EventDescription,120,4000,'....')AS'Description',GalleryTitle,LEFT(Gallerytitle,(charindex('_',Gallerytitle)-1))as Title,EventYear,EventDescription,gallerytitle, gallery FROM(SELECT photography_events.*,row_number()OVER(PARTITIONBY gallerytitle ORDERBY gallery DESC)AS RN FROM photography_events)AS t WHERE RN =1ORDERBY EID