Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
antony_dba
Starting Member
26 Posts |
Posted - 2010-11-29 : 02:36:09
|
TABLE1Suggest the query for the result table...a b c- - -1 3 231 4 322 5 32i need the result table asa b c- - -1 3 23- 4 322 5 -kriskris |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2010-11-29 : 02:44:30
|
This looks more a reporting need and should be handles in the front end.If you necessarily want to do this with an sql query, You should have an identity field there. Do you have one there ? |
|
|
antony_dba
Starting Member
26 Posts |
Posted - 2010-11-29 : 02:47:59
|
how to specify the null values for duplication values in sql querykris |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-11-29 : 07:36:44
|
This is something that should be done in the front end, in the reporting tool, not in the database.--Gail ShawSQL Server MVP |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-11-29 : 07:49:47
|
lolselect a=case when aseq=1 then a else null end ,b=case when bseq=1 then b else null end ,c=case when cseq=1 then c else null end from (select a,b,c,aseq = row_number() over (partition by a order by a,b,c),bseq = row_number() over (partition by b order by a,b,c),cseq = row_number() over (partition by c order by a,b,c)from Table1) aorder by a.a, a.b, a.c==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-11-29 : 08:46:07
|
This feature is known as Suppress if duplicated. If you want to show data in a front end application, do this thereMadhivananFailing to plan is Planning to fail |
|
|
|
|
|
|
|