Community discussion forum

select same record from multiple table

Tags: sql India
  • 1 year ago

    hi all,

    I have a pblm to select the same field namely tripid from multiple tables.

    Actually i want to exclude a tripid if it is in any of the table with same route.

    i need to check if it is in any of there is four tables tb1, tb2 tb3, tb4....

    can anybody help me....

    thank you

    Binu

  • 1 year ago
    Hi, You will have to provide more information in order to receive a meaningful response, what exactly do your tables llok like?  Without seeing your table structure I would guess that you could use a NOT IN query, ie. select tripid from yourtable where tripid not in(select tripid from tb1) and tripid not in(select tripid from tb2) and tripid not in(select tripid from tb3) etc.. 

    I will try and help further if you give more information.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!