Home » RDBMS Server » Server Administration » Formatting results
Formatting results [message #371428] Tue, 17 October 2000 13:06 Go to next message
Hocine
Messages: 1
Registered: October 2000
Junior Member
I have two tables:
table1(id, first_name, last_name) with id:PK
table2(id, discipline, note1, note2) with id FK to table1

I would like to format the results from :

select first_name, last_name, discipline,note1, note2
from table1 a, table2 b
where a.id=b.id

What I want to get is something like :
first_name last_name discipline note1 note2 discipline note1 note2
student1 ln_st1 maths 12 10 physics 13 11
student2 ln_st2 geophy 10 9 maths 11 9
...

I mean as long as id is the same the columns selected from table2 still on the same line.
Re: Formatting results [message #371515 is a reply to message #371428] Wed, 01 November 2000 07:14 Go to previous message
Just Me
Messages: 10
Registered: November 2000
Junior Member
just write :

select
first_name||' '||
last_name||' '||
discipline||' '||
note1||' '||
note2
from table1 a, table2 b
where a.id=b.id
Previous Topic: How to delete the rows from a table with rownum is a multiple of 3
Next Topic: UTL_FILE Problem?
Goto Forum:
  


Current Time: Thu May 02 00:04:12 CDT 2024