Can some one helpme how to display the similar column value only one time in query?
Same answer as two weeks ago :-)
But this time there seems to be an additional intermediate aggregate, which can be easily done in BTEQ adding "WITH SUM(id) BY code" at the end of the query.
Otherwise it might probably be done with GROUP BY GROUPING SETS...
But it looks like a report, so your reporting tools should handle that.