Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
btkaruna
Starting Member
8 Posts |
Posted - 2010-06-23 : 06:20:36
|
| Hi,I am able to generate records in following format using group byBranchid Name Mobile1 Harsha Priyadarshini 9989651451 1 Bhanu Prakash 3232323201 hari Prakash 3232321 Saritha 3223233232 2 vamsi 9989651451 2 karuna 3232323202 surya 3232322 Saritha 3223233232But i need to generate records in the following mannerBranchid : 1Name MobileHarsha Priyadarshini 9989651451 Bhanu Prakash 323232320Bhanu Prakash 323232Saritha 3223233232 Branchid : 2vamsi 9989651451 karuna 323232320surya 323232Saritha 3223233232Thanks |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-06-23 : 06:34:55
|
| You want that o/p to be generated by SQL?Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
|
btkaruna
Starting Member
8 Posts |
Posted - 2010-06-23 : 06:37:59
|
| yes, i require sql to get the out put. |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-06-23 : 07:02:48
|
| Why. -- This is an easy thing to do in your application layer. just keep a count of the first column and output the Branchild : <number> only when it changes.This is awkward, slow and ugly to do in sqlCharlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
Sachin.Nand
2937 Posts |
|
|
|
|
|