Jump to content

flagging record in table A if it does not have a corresponding record in table B


peppericious

Recommended Posts

Supposing I have 2 tables, A and B.

 

For every record in A, there's supposed to be a corresponding one in B. However, there are a few records in A which *don't* have a corresponding record in B. I want to flag these records in A.

 

A is like this:

 

id | some_col flag

=================================

1 | S71D431W 0

2 | P79D431V 0

3 | S79R431Y 0

4 | Y085HG5D 1  (a corresponding record should exist in B with this value, but doesn't, so flag it)

5 | A79E433V 0

 

 

B is like this:

 

f_some_col | another_col

===========================

S71D431W | ..

P79D431V | ..

S79R431Y | ..

A79E433V | ..

 

Can anyone tell me how to loop through the records in A, flagging records which do not have a corresponding record in B?

 

Thx in advance... I don't know whether this is an extremely simple thing... the solution is eluding me, however...

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.