Solved

Inserting Space when a Break Column's Value Changes

Posted on 2012-04-09
3
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Expert Comment

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

Author Comment

by:VenkatBunny
ID: 37826051
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
ID: 37827573
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

627 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