I need to transpose rows as columns.
FOr example consider two tables Cust( cno , cname) and Accts(cno,acctno,amt)
cno is the foreignkey between cust and accts.
cno is the primary key in Cust and acctno is the primary key in Accts.
I want a sql for getting all the acc details for a customer in a single row.
(i.e)
Cust :
Cno cname
--- -----
100 Mark
101 Taylor
Accts:
Cno Acctno AMt
--- ------ ---
100 A909 $5000
100 A209 $10000
101 A200 $20000
101 A400 $30000
I want the results to be displayed as
100 MArk A909 $5000 A202 $10000
101 Taylor A200 $2000 A400 $30000
Can somebody Help !!
FOr example consider two tables Cust( cno , cname) and Accts(cno,acctno,amt)
cno is the foreignkey between cust and accts.
cno is the primary key in Cust and acctno is the primary key in Accts.
I want a sql for getting all the acc details for a customer in a single row.
(i.e)
Cust :
Cno cname
--- -----
100 Mark
101 Taylor
Accts:
Cno Acctno AMt
--- ------ ---
100 A909 $5000
100 A209 $10000
101 A200 $20000
101 A400 $30000
I want the results to be displayed as
100 MArk A909 $5000 A202 $10000
101 Taylor A200 $2000 A400 $30000
Can somebody Help !!