Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

How to get 2 value from same id and same column? - response (3) by dnoeth

$
0
0

For your example (up to two rows per ID) there's a simple solution:

SELECT ID, Customer, 
  MIN(Book) || COALESCE(',' || MAX(Book), ''), SUM(Price)
FROM tab
GROUP BY 1, 2

But it's probably more complicated and i don't have a clue what you actually want.
 
Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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