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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL : SubQuery

SQL : SubQuery

Scheduled Pinned Locked Moved Database
databasehelp
3 Posts 2 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.
  • D Offline
    D Offline
    dev_rfid
    wrote on last edited by
    #1

    hi i have three tables named A,B,C having common field srno. A b c ---- ------- ---- srno srno srno ---- ------- ------ 101 101 102 102 105 103 104 105 i wrote a query like : (A.srno) - (B.srno) - (C.srno) and my ans is :103 and 104 but in a critical situation 102 is again inserted in A. not assign to B or C. but didn't display in my query. plz. help me.

    C 1 Reply Last reply
    0
    • D dev_rfid

      hi i have three tables named A,B,C having common field srno. A b c ---- ------- ---- srno srno srno ---- ------- ------ 101 101 102 102 105 103 104 105 i wrote a query like : (A.srno) - (B.srno) - (C.srno) and my ans is :103 and 104 but in a critical situation 102 is again inserted in A. not assign to B or C. but didn't display in my query. plz. help me.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      I don't understand what you are trying to achieve. Could you explain? Also, what is your current SELECT statement? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

      D 1 Reply Last reply
      0
      • C Colin Angus Mackay

        I don't understand what you are trying to achieve. Could you explain? Also, what is your current SELECT statement? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

        D Offline
        D Offline
        dev_rfid
        wrote on last edited by
        #3

        sorry, i couldn't explain properly. i am trying to explain by example : i have two tables A and B having common field SRNO. in table A i have values 101,101,101,102,102,103. in table B i have values 101,102. i want to write a query from A nad B, which provide me the output : 101,101,102,103. means : 101,101,101 in A - 101 in B = 101,101 in Output 102,102 in A - 102 in B = 102 in output 103 in A - null = 103 in output actually i wrote like : select srno from A where srno not in (select srno from B) but it eliminate all the instances of srno. the output is only :103. but i want as defined above. could i tried well to make you understand my problem? thanks:rose: -- modified at 5:21 Saturday 11th February, 2006

        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