Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining Multiple Output from SQL Into a Single Row

Status
Not open for further replies.

ihda

MIS
Apr 6, 2001
46
US
I'm new to SQL and have a question regarding the combining of data.

I have a SQL query that accesses three tables and is producing four records with the fields:
Loan number, Loan type 1, Loan type 2.

The loan number is the key on all three tables

Table 2: Loan type values: 'A', 'B'
Table 3: Loan type values: 'C', 'D'

SQL Output:
(from table 1) (from table 2) (from table 3)
12345 A C
12345 A D
12345 B C
12345 B D

Is there a way to combine the output in the query to form a single row?
Example: 12345 A B C D


Thank you
 
Ther's no generic way to do it. At least unless the number of distinct values is restricted. You should understand that the number of columns in the result set must be known before executing select statement.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top