How to display the similar column value only one time in query?

General
Enthusiast

How to display the similar column value only one time in query?

HI ,

Can some one helpme how to display the similar column value only one time in query?

ex:

Code  id

===   ===

Pune   105

Pune   100

pune   200

Hyd     100

Hyd     200

Hyd     300

Expected Output:

Code     id

====    ===

Pune     105

             100

             200

             ====

              405

             ====

Hyd       100

             200

             300

         ======

             600

         ========

1 REPLY
Senior Apprentice

Re: How to display the similar column value only one time in query?

Same answer as two weeks ago :-)

http://forums.teradata.com/node/11134

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.

Dieter