user2919234
user2919234

Reputation: 1

Splitting the data through SSIS

I have a table "Employee" as shown below

Id    Name
1     John
2     Jaffer
3     Syam
4     Aish
5     Gidson
1     Aboo
2     Sindhu
3     Saravanan

I want to get two outputs like

Id        
1         
2         
3

Id
4
5

Which transformation should i use?

Could you Please help on that?

Upvotes: 0

Views: 40

Answers (1)

Shahid Iqbal
Shahid Iqbal

Reputation: 2135

You will have to write two queries.

SELECT      Id    
FROM        Employee
GROUP BY    Id    
HAVING      COUNT(Id)>1

The above query will give you first output

SELECT      Id    
FROM        Employee
GROUP BY    Id    
HAVING      COUNT(Id)=1

This will give you 2nd output.

Upvotes: 1

Related Questions