Question

Locked

combining SQL rows according to data

By john.a.wills ·
Tags: Software
I have an SQL query which yields people's telephone numbers and the kinds of the telephone numbers. It is produced by Argos, but I don't think that matters much: I know what kind of SQL I am indirectly writing and, indeed, I have had to go into quite a lot of low-level detail already. When a person has two identical entries for the telephone number, of identical types, I can make one row of them both by using DISTINCT. When for one person the same telephone number occurs twice with different types I should combine the types into a single entry (if the same telephone comes up as type 1 and as type 2, I want it to be type 3). How do I do that?

If a person has 2 different telephone numbers (2 rows in the present query), I want the information for the person in a single row, with the telephone information all in the same column, with separation by semicolon. How do I get that?

Someone here has suggested use of the SQL function ListAgg, but it is not clear to us just how I should use it.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums