• Advertisement
Sign in to follow this  

Can someone explain to me this sql statement

This topic is 764 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

SQL = "INSERT INTO zdCathCleaningStatus (SS_Event_Cath_ID)" _
& " SELECT Event_Cath.SS_Event_Cath_ID" _
& " FROM zdCathCleaningStatus RIGHT JOIN Event_Cath ON zdCathCleaningStatus.SS_Event_Cath_ID = Event_Cath.SS_Event_Cath_ID" _
& " WHERE zdCathCleaningStatus.SS_Event_Cath_ID Is Null" _

Share this post


Link to post
Share on other sites
Advertisement
It looks like it adds a row to the zdCathCleaningStatus table wherever a row exists in the Event_Cath table that doesn't already have a foreign key relation to the zdCathCleaningStatus table via the SS_Event_Cath_ID column.

In short it prevents duplicate entries in the cleaning status table in a strange way.

What's this code from out of curiosity?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement