Updating with a Self-Join - SQL Server

The following SQL will copy the SnippetId from the folder "table" onto the ParentId of the item table.

update
    item
set
    item.ParentId  = folder.SnippetId        
from
    dbo.Snippet item
    inner join dbo.Snippet folder
        on item.SnippetGroupId = folder.SnippetIndex
        and item.FolderFlag = 0
        and folder.FolderFlag = 1