Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Need help for Customize the except query

Need help for Customize the except query

Scheduled Pinned Locked Moved Database
databasehelptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    ptr_Electron
    wrote on last edited by
    #1

    I need one column from the table1 which need not be used comparassion but I need the colume (ID colum in this case)to get lised in the query result. Ex :

    select ID a,b,c from table1 except select a,b,c from

    table2

    in the above example ID color of Table1 need not be compared with table to but just required in the query result for each rows. Thanks in advance

    J M 2 Replies Last reply
    0
    • P ptr_Electron

      I need one column from the table1 which need not be used comparassion but I need the colume (ID colum in this case)to get lised in the query result. Ex :

      select ID a,b,c from table1 except select a,b,c from

      table2

      in the above example ID color of Table1 need not be compared with table to but just required in the query result for each rows. Thanks in advance

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      I think some of your post was truncated. As a guess if you are suggesting that you want to return rows from two tables where there is no common columns between them then the answer is simple - use two queries.

      1 Reply Last reply
      0
      • P ptr_Electron

        I need one column from the table1 which need not be used comparassion but I need the colume (ID colum in this case)to get lised in the query result. Ex :

        select ID a,b,c from table1 except select a,b,c from

        table2

        in the above example ID color of Table1 need not be compared with table to but just required in the query result for each rows. Thanks in advance

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        If you are looking for records in table 1 where A,B,C records are not in table 2 then the following should help

        Select * from table1 T
        where not exists(Select * from Table2 TT where T.A = TT.A and T.B = TT.B and T.C = TT.C)

        Never underestimate the power of human stupidity RAH

        P 1 Reply Last reply
        0
        • M Mycroft Holmes

          If you are looking for records in table 1 where A,B,C records are not in table 2 then the following should help

          Select * from table1 T
          where not exists(Select * from Table2 TT where T.A = TT.A and T.B = TT.B and T.C = TT.C)

          Never underestimate the power of human stupidity RAH

          P Offline
          P Offline
          ptr_Electron
          wrote on last edited by
          #4

          Gr8 sir .. it worked .. you made my weekend :) ... I wish you a wonderfull weekend. :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups