Gossamer Forum
Home : General : Databases and SQL :

SQL problem - need help please!

Quote Reply
SQL problem - need help please!
Hello all, I've tried different kinds of joins, etc., to no avail on the following problem, and can't solve this without getting duplicate lines of data. Help would be greatly appreciated. I hope these columns line up, but effectively I'm trying to concatenate text fields grouped by their unique id, so that the id, full issue text, and full outcome text are represented by the unique id for the event. (It's not my database; can't imagine why it is setup like this).

Thanks,

gnixon

Table issue

id issue_text

0001 Customer unhappy

0001 with goods. Wanted

0001 red, got blue.

0002 Manager was rude.



Table outcome

id outcome_text

0001 Sent red, resolved.

0002 Manager will

0002 send apology.



Desired Result as Follows:

issue.issue_text outcome.outcome_text

0001 Customer unhappy with goods. Wanted red, got blue. Sent red, resolved.

0002 Manager was rude Manager will send apology.
Quote Reply
Re: [gnixon] SQL problem - need help please! In reply to
Hi gnixon,

It's not your database you say, but let me just clearify... Is "id" the key, and if so, is there really more than one row with the same key?

/ Netmos