My Sql query is,
Select CustomerName,ProjectID,ProjectDesc from dbo.projects
The Output is:
CustomerName ProjectID ProjectDesc
A3 Consulting FZ, LLC. 277 A3
A3 Consulting FZ, LLC. 278 A3 - Chef
Anesthesia Business Consultant 279 Astra
ARI Network Services, Inc. 280 Mira
What i want is,the project desc should be in row as per the customer.
CustomerName ProjectDesc ProjectID
A3 Consulting FZ, LLC.
A3 277
A3 - Chef 278
Anesthesia Business Consultant
Astra 279
ARI Network Services, Inc.
Mira 280
I agree with the comments, this is not a Query issue, but a display issue. But if you really want to do it in SQL, try this.
It will give you what you want, but it has an extra sort key column on the end that your front end will need to get rid of…
Here is another approach if you want to hide that key
This approach will convert the ugly key into a series of sequential numbers. But just because this CAN be done in SQL, doesn’t mean it SHOULD be…