Query Help/Suggestions [56 K WARNING - < 15k of images]
Posted: Tue Sep 19, 2006 7:38 pm
Greets,
What would be the easiest way to achive an output like this one.

From the db structured as shown here.

Here's the query I have at the moment
... and this is the output
Producing something like this would be ideal. However I'm not sure if it's possible with current table structure.
I guess, i'm looking for a query that'll require minimal hacking on the php end. I'm looking to handle the query in the view or stored procedure. DB is postgresql.
Greatly appreciated.[/img]
What would be the easiest way to achive an output like this one.

From the db structured as shown here.

Here's the query I have at the moment
Code: Select all
select
client.name,
client_score.start_score,
client_score.update_score,
client_score.target_score,
bureau.name
from client
join client_score on( client.id = client_score.client_id_fk )
join bureau on (client_score.bureau_id_fk = bureau.id )
where
client.id = 3;Code: Select all
name | start_score | update_score | target_score | name
-------------+-------------+--------------+--------------+------------
Jon Doe III | 300 | 300 | 620 | Experian
Jon Doe III | 300 | 333 | 620 | Equifax
Jon Doe III | 300 | 300 | 620 | TransunionCode: Select all
name | start_score | update_score | target_score | start_score | update_score | target_score | start_score | update_score | target_score |
-------------+-------------+--------------+--------------+-------------+-------------+--------------+--------------+-----------------------------+
Jon Doe III | 300 | 300 | 620 | 300 | 333 | 620 | 300 | 300 | 620 |I guess, i'm looking for a query that'll require minimal hacking on the php end. I'm looking to handle the query in the view or stored procedure. DB is postgresql.
Greatly appreciated.[/img]