August 7, 2014 at 7:57 am
Hi
I have a table like below.
ID eIDinCountoutCount
417720NULL NULL
1000010331 7
1000010346 1
100001035NULL 1
1000010361 NULL
1000010362 NULL
1000010361 1
I want to table output like below
ID1033COUNT1033COUNT1034COUNT1034COUNT
417721761
100001761
100001761
Please help. Thanks
August 7, 2014 at 8:12 am
m.mukesh.mca2009 (8/7/2014)
HiI have a table like below.
ID eIDinCountoutCount
417720NULL NULL
1000010331 7
1000010346 1
100001035NULL 1
1000010361 NULL
1000010362 NULL
1000010361 1
I want to table output like below
ID1033COUNT1033COUNT1034COUNT1034COUNT
417721761
100001761
100001761
Please help. Thanks
You have duplicate rows and duplicate columns in your sample output. Can you explain why? Or correct it to match what you really want.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 7, 2014 at 8:29 am
Also, please verify that your expected output is based on your sample data. I'd expect the current version doesn't.
August 7, 2014 at 9:53 am
While you are figuring out what you really want (and scripting sample tables/data for us to help you better), search the web for sql server CASE pivot and see if you can do it yourself
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
August 7, 2014 at 10:07 pm
Hi, eID have only unique values but ID may have duplicate values
August 8, 2014 at 12:07 am
m.mukesh.mca2009 (8/7/2014)
Hi, eID have only unique values but ID may have duplicate values
By being lazy and not providing what people are asking for, you are making this thread more painful than it needs to be.
If you will not take the time to provide accurate sample data and desired output which matches the sample data, why should the unpaid volunteers here take the time to help you out?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 8, 2014 at 1:30 am
m.mukesh.mca2009 (8/7/2014)
Hi, eID have only unique values but ID may have duplicate values
That doesn't match the sample data you provided.
ID eID inCount outCount
41772 0 NULL NULL
10000 1033 1 7
10000 1034 6 1
10000 1035 NULL 1
10000 1036 1 NULL
10000 1036 2 NULL
10000 1036 1 1
Seems like you're not really interested to get the issue resolved. I'm out.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply