extracting unique return results

hello everybody,


I have a query (with subqueries) which returns 4 rows each named .ContactID (just my name for the variable return)


My question is: how can I join Col1.ContactID and Col2.ContactID and Col3.ContactID and Col4.ContactID in one Column ,let's name

it Result, and in such a way that I don't get any value more then once? (DISTINCT?)


So I would like to become as a result: Result.ContactID where ContactID only has unique values.


I tried a couple of times with some JOIN statements but I'm still pretty new to SQL. Forgive me if this is basic stuff, but I just don't see a

way out. Any help/tip is greatly appreciated, thanks.


Hiro.




Comments

  • : hello everybody,


    : I have a query (with subqueries) which returns 4 rows each named .ContactID (just my name for the variable return)


    : My question is: how can I join Col1.ContactID and Col2.ContactID and Col3.ContactID and Col4.ContactID in one Column ,let's name

    : it Result, and in such a way that I don't get any value more then once? (DISTINCT?)


    : So I would like to become as a result: Result.ContactID where ContactID only has unique values.


    : I tried a couple of times with some JOIN statements but I'm still pretty new to SQL. Forgive me if this is basic stuff, but I just don't see a

    : way out. Any help/tip is greatly appreciated, thanks.


    : Hiro.

    :


    Try UNION






  • : : hello everybody,


    : : I have a query (with subqueries) which returns 4 rows each named .ContactID (just my name for the variable return)


    : : My question is: how can I join Col1.ContactID and Col2.ContactID and Col3.ContactID and Col4.ContactID in one Column ,let's name

    : : it Result, and in such a way that I don't get any value more then once? (DISTINCT?)


    : : So I would like to become as a result: Result.ContactID where ContactID only has unique values.


    : : I tried a couple of times with some JOIN statements but I'm still pretty new to SQL. Forgive me if this is basic stuff, but I just don't see a

    : : way out. Any help/tip is greatly appreciated, thanks.


    : : Hiro.

    : :


    : Try UNION


    Thank you very much, it worked after I redefined my subqueries


    thanks,


    Hiro




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories