Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Want the all rows expect the first for a partcular column to be zero.

$
0
0

My query generates data similar to below:

Accountnum        Amount     Amount2

--------------       ----------    ----------

001                    100.00       100.00

002                    200.00         50.00

002                    200.00         45.00

002                    200.00         99.00

I want the query to display the Amount value for only the first row per Accountnum.  The remaining rows should be 0 for that column. (Amount2 should remain the same). Like this:

Accountnum        Amount     Amount2

--------------       ----------    ----------

001                    100.00       100.00

002                    200.00         50.00

002                            0         45.00

002                            0         99.00

 

Any suggestions? Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>