Hi All,
I Have A Query that returns rows like the picture below...
Now I want an xml like this
from the query.
How do i do it? Or If Its Really Possible In SQL Server? 'Coz I read somewhere you can't use group by in select when using FOR XML Command.
Pls help. Thanks :)
I Have A Query that returns rows like the picture below...
Now I want an xml like this
Code:
<Employees>
<Group GroupId="8">
<Employee>Manju</Employee>
<Employee>Sudip</Employee>
</Group>
<Group GroupId="12">
<Employee>Raja</Employee>
<Employee>Shambo</Employee>
......
</Group>
.......
</Employees>
How do i do it? Or If Its Really Possible In SQL Server? 'Coz I read somewhere you can't use group by in select when using FOR XML Command.
Pls help. Thanks :)
Comment