non-duplicate data from 2 seperate tables help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • killswitch101
    New Member
    • Mar 2008
    • 2

    non-duplicate data from 2 seperate tables help

    I need to get all of the non-duplicate data out of 2 tables (ci and hi)
    i can't seem to work it out
    i think i need to use the minus command but that will only display the data for 1 table
    can anyone help
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by killswitch101
    I need to get all of the non-duplicate data out of 2 tables (ci and hi)
    i can't seem to work it out
    i think i need to use the minus command but that will only display the data for 1 table
    can anyone help
    Could you please post what you have tried so far?

    Comment

    • killswitch101
      New Member
      • Mar 2008
      • 2

      #3
      select
      from ci
      minus
      select
      from hi;
      so far ive tried that but it only shows the data from ci and not hi like i want it to

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Originally posted by killswitch101
        select
        from ci
        minus
        select
        from hi;
        so far ive tried that but it only shows the data from ci and not hi like i want it to
        Try this:

        [code=oracle]

        select * from ci
        UNION
        select * from hi

        [/code]

        Comment

        Working...