Use 2 of the same table in JSR query

Is it possible to use 2 of the same table in a JSR query like what we can do with SQL?

example:
SELECT C2.CONTENTID FILEID, C2.CURRENTREVISION REVISION, PSX_RELATIONSHIPS.OWNERID
FROM CONTENTSTATUS, CONTENTSTATUS C2, PSX_RELATIONSHIPS
WHERE
CONTENTSTATUS.CONTENTID = :“PSXSingleHtmlParameter/sys_contentid”
AND CONTENTSTATUS.CURRENTREVISION = :“PSXSingleHtmlParameter/sys_revision”
AND C2.CONTENTTYPEID = 309
AND LTRIM(RTRIM(UPPER(C2.TITLE))) LIKE ‘%’+ LTRIM(RTRIM(UPPER(CONTENTSTATUS.TITLE))) + ‘%’
AND CONTENTSTATUS.COMMUNITYID = C2.COMMUNITYID
AND PSX_RELATIONSHIPS.CONFIG = ‘Folder Content’
AND PSX_RELATIONSHIPS.DEPENDENTID = C2.CONTENTID

If not here is what I need to do:
I am working on converting our XSL to velocity, anyway we have a content type that gets linked to a file (.pdf) by their titles. Then in the mapper it gets sent into the sys_MakeIntLink() function so I can create a link on the original content types page. Do you have a better way of doing this in velocity?

The short answer to your question is No, you cannot join two tables in a JCR Query.

However, you have already have the “title” field (use $sys.item.getProperty(“sys_title”) to get the title) so you can pass it to the query without doing a join.

I don’t understand what the “folder content” relationship is used for in this query.

Dave