Results 1 to 2 of 2

Thread: Selecting details on inner query

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    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.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width