Selecting details on inner query
I'm not really into SQL programming but I need some query to select master including the details on just one result rest. This is weird but the format is something like this
Master
code | description
Details
code | another_description
So if I have data like
001 | Ballpen
and I have
001 | Freak ballpen
002 | Cool ballpen
I can select them by joining but what if I only have to return a query based from the master and concatenating the details delimited by some characters. Something like
001 | Ballpen | Freak ballpen, Cool ballpen
As I said, I'm not into SQL so any help is greatly appreciated. Thanks a bunch.
Edit: This is Oracle btw, but ideas are appreciated. My big thanks.
Re: Selecting details on inner query
where is the link or which field will be used to link the master and details table....anyway using this query you can get some idea...
Code:
SELECT Master.code AS MasterCode, Master.Description AS MasterDescription, Detail.AnotherDescription AS DetailDescription
FROM Master INNER JOIN Details ON Master.Code = Detail.Code