sqlindia (12/26/2012)
I have a query that need to Rewrite it without cursor, function or loop to produce same result and should be included in ONE SELECT (no temporary object involved).
Why those restrictions? Sounds like rules for a test or competition...
Look up the FOR XML method of string concatenating.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability