Solved

Inserting Space when a Break Column's Value Changes

Posted on 2012-04-09
3
245 Views
Last Modified: 2012-04-10
Hi,

I want to insert a space when a column's value changes in SQL

ID        LAST_NAME                     SALARY
------------- ------------------------- ----------
20         Hartstein                      13000

80         Russell                           14000
              Partners                       13500

90          King                               24000
              Kochhar                        17000
0
Comment
Question by:VenkatBunny
3 Comments
 
LVL 23

Expert Comment

by:wdosanjos
Comment Utility
You should use a reporting tool such as SSRS to achieve that.
0
 

Author Comment

by:VenkatBunny
Comment Utility
Is there Anyway to group the ID by not displaying the ID in MS SQL

ID        LAST_NAME                     SALARY
------------- ------------------------- ----------
20         Hartstein                      13000
80         Russell                           14000
              Partners                       13500
90          King                               24000
              Kochhar                        17000
0
 
LVL 18

Accepted Solution

by:
deighton earned 150 total points
Comment Utility
SELECT case when rowx = 1 then cast(tt.id as nvarchar(10)) else '' end, tt.Last_name, tt.salary FROM  (select id,last_name,salary,row_number() over (partition by id order by salary) as rowX from YourTable) tt
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now