Filtering the rows with missing refference elements

Options

Hello, some of the elements that are used as a refference have been deleted from the database, and now I would like to find and remove the rows that have the 'refference no longer exists'


Couldn't find a way to do that correctly 😅


Tagged:

Best Answer

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    I would make a function that queries the table in question, and for each result, check to see if the referred value exists in the other table through using a get record. If it comes back null, delete the record in the first table!


    There are some techniques that can improve the performance of this process, but if the N isn't huge and/or the scrubbing is done infrequently, I wouldn't worry about it too much. Either way, focus on making it work in a way that makes sense to you first.