All Forums General
ksaikrishna 26 posts Joined 08/11
10 Jul 2012
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

         ========

 

 

dnoeth 4628 posts Joined 11/04
10 Jul 2012

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

Dieter

You must sign in to leave a comment.