Links in field document (filename) are broken

Hi maybe someone can help?

if you create a grid with custom sql code and a field pdf_data (this is
document filename type)
this works with the following simple select and
shows working links to stored pdf files in the grid.

SELECT
login,
anl_id,
pdf_data,
uploaded

FROM grunddaten
WHERE login = [login]

If you modify the select statement with a JOIN you get the same grid but
with broken links to the pdf documents and error that the document does not
exist.

SELECT
grunddaten.login,
grunddaten.anl_id,
grunddaten.pdf_data,
grunddaten.uploaded,
user.user_id

FROM grunddaten, user
WHERE login = [login]

Now the links to the documents (pdf_data, type document filename) don’t
work anymore. Why?

Anyone any idea?