Query for getting all unique data from 2 Tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • keirnus
    New Member
    • Aug 2008
    • 48

    Query for getting all unique data from 2 Tables

    Hello,

    I actually don't know where to post for SQL Queries used in MS Access.
    If this is not the correct thread, please redirect this to the correct one.

    Anyway, I am kinda newbie to the query I want here.

    Let's say TABLE1 has the following data:
    <ColumnLetter >
    A
    B
    C

    TABLE2 has the following data:
    <ColumnLetter >
    B
    C
    D

    How can I get all the unique data in this form?
    A
    B
    C
    D

    I am sorry if I am too noob on this.
    Last edited by keirnus; Jan 7 '10, 02:16 AM. Reason: Added sample column name
  • keirnus
    New Member
    • Aug 2008
    • 48

    #2
    Oooops! I did it again...got it already (with the help of my friends)...

    The answer is UNION...
    The query would be like this:
    Code:
    SELECT ColumnLetter
    FROM TABLE1
    UNION SELECT ColumnLetter
    FROM TABLE2;
    It is my first time to use this query...hehe.
    I admit, I am noob...Thanks for reading anyway.
    Last edited by NeoPa; Jan 7 '10, 09:55 PM. Reason: Please use the [CODE] tags provided

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      Not a problem. This stands as an illustration of your problem with a suitably posted solution (perfectly correct btw). For more help in this area see Finding Jet SQL Help.

      Comment

      Working...