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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.