I was really just suggesting you look at that lookup as an example to see the sort of dynamic query you might need to use.
But looking at that NSQL, it seems the lookup is actually trying to display subprojects not tasks - suggest you try with a copy of that but with the NSQL with the last line;
task.pristask = 1
instead.
Also, I seem to recall problems with that sort of lookup and using browse lookups ; try swapping it to a pulldown?
--
However, I would probably use a parameterised dynamic-lookup myself for this sort of problem (passing in the object id into the NSQL to drive the query, rather than referencing the URL) - so sorry for the slightly misleading advice initially, but I was having to GUESS a bit at your use-case
In that case the NSQL would look like this;
SELECT @SELECT:task.prid:prid@,
@SELECT:task.PRUID:UNIQUE_CODE@,
@SELECT:task.prexternalid:prexternalid@,
@SELECT:task.prname:prname@
FROM prtask task
WHERE @FILTER@
AND task.prprojectid = @WHERE:PARAM:USER_DEF:INTEGER:project_id@
AND task.pristask = 1
and where you create the attribute in the CHANGE REQUEST object you need to map the project_id to pk_id in the 'Lookup Parameter Mappings' section that you should see.