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. how to check the value simaltanously from 2 table

how to check the value simaltanously from 2 table

Scheduled Pinned Locked Moved Database
databasetutorial
2 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.
  • B Offline
    B Offline
    biswa47
    wrote on last edited by
    #1

    there is 2 table named table 1 and table 2 in the db where both table have a comman coloumn named employee_code. let table1 conatain emplyee_code-1,2,6,8,9 and table2 contain employye_coce-2,4,6,7,8 now i want a sql statement which will give me the out put as follows i want to check(let say employee code1) wather a particular employee_code present in table 1 and not present in table2 .if it run succesfully it should give massage emplyee code exists else doesn't exists. means if i select emp_code 1 then the message would be "emplyee code exists" i select emp_code 2 then the message would be "emplyee code doesnt exists"

    P 1 Reply Last reply
    0
    • B biswa47

      there is 2 table named table 1 and table 2 in the db where both table have a comman coloumn named employee_code. let table1 conatain emplyee_code-1,2,6,8,9 and table2 contain employye_coce-2,4,6,7,8 now i want a sql statement which will give me the out put as follows i want to check(let say employee code1) wather a particular employee_code present in table 1 and not present in table2 .if it run succesfully it should give massage emplyee code exists else doesn't exists. means if i select emp_code 1 then the message would be "emplyee code exists" i select emp_code 2 then the message would be "emplyee code doesnt exists"

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Use the EXISTS[^] operator to check for the existence of rows with a particular employee code in table 2.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      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