[SalesForce] How do i join ContentDocumentLink with Account with SOQL query

I want to find a file(ContentDocument) which is associated with a particular account with SOQL. I have tried below query.

Select LinkedEntityId,ContentDocumentId from ContentDocumentLink where Account.Id == LinkedEntityId

But it throws me an error as unknown error parsing query

I understood both Object structure from this.
Id of account is primary look like primary key of account entity and LinkedEntityId of ContentDocumentLink shows the reference type of field. It means it could be linked with other entity such as entityType, user and group(as permission is assigned).

So what is another possible way to find associated contentDocument from the account id or any suggestion on my existing query.

Best Answer

Your WHERE clause has an issue.

It should be

WHERE LinkedEntityId = :Account.Id