Need Query [message #423794] |
Mon, 28 September 2009 05:26  |
mamalik
Messages: 270 Registered: November 2008 Location: Pakistan
|
Senior Member |

|
|
Dear All
My query is returning data like follwing.
NAME VALUE
A 1
A 1
B 2
look "A" is appearing twice in above ,value for 2nd "A" should be 0.
I need a query which return 0 values if name is duplicating.If a name is appearing more than one time ,value should be return in first row and 0 in other rows.
now result of above data should be
NAME VALUE
A 1
A 0
B 2
Name "A" can repeart more than two times.
Best Regards.
Asif.
|
|
|
|
|
|
Re: Need Query [message #423803 is a reply to message #423796] |
Mon, 28 September 2009 07:17   |
 |
Michel Cadot
Messages: 68761 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:I knew that i will get anger by this posting. I am really sorry.
No you are not otherwise you would post it correctly, with format, with columns aligned, with test case, with version number on 4 decimals...
Regards
Michel
[Updated on: Mon, 28 September 2009 07:17] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Need Query [message #424059 is a reply to message #424044] |
Wed, 30 September 2009 02:38  |
 |
Michel Cadot
Messages: 68761 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
delna.sexy wrote on Wed, 30 September 2009 08:17Actually I posted the clue before answer.
Quote:ROW_NUMBER() with CASE can solve your problem.
Then also he was asking answer, and that's why I replied with answer.
regards,
Delna
Yes I know you posted a clue (read my post I mentioned it).
Yes, of course, he asks for a solution, he asked it from the first post, this is not a reason to post it unless he proved he made at least a small effort to find it.
Regards
Michel
|
|
|