Jump to content

Query Problem


shan_cool

Recommended Posts

Hi all,
        I have two tables "table1" and "table2" and "id" is the field common to both the tables..  All id data will be in "table1" say 10,20,30,40,50,60  . but only few of them will get stored in "Table2" say 20 ,40.

Now i need the retrieve the values of id's that are in "table1" and not in "table2" Ex: 10,30,50,60.

My query is

"Select h1.id from table1 h1,table2 h2 where h1.id Not In(h2.id)"

"Select h1.id from table1 h1,table2 h2 where h1.id <>2.id)"

both display Repetition of all values and gives me 'n' number of records.. cartesian product

plz lemmme know how to do it?

Thx in advance,
Shan
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.