In the SQL query below, I have 2 tables, documents and document user map. In documents table it has columns documentId, documentname and userid; and in doumnent usermap table it has documentid and userid. The documents that we create will be in documenttable (created documentid, userid). The documents we share to other users will be in documentusermap table (documentid .other userid).here i have to pass my userid to sp

My aim is I want to get documents what other users shared for me.

```
@i_userid int,
SELECT      Doc.UserID,
            Doc.DocumentID,
            Doc.DocumentName 

FROM        Documents Doc 

LEFT OUTER JOIN DocumentUserMapping DUM 
    ON      DUM.DocumentID = Doc.DocumentID 
    AND     DUM.UserID != Doc.UserID

```