Easiest - create a view on the SQL server (select DISTINCT my fields from table1 where exists (select id from table2 where table1.id = table2.id)). Import that view into your dictionary. Use that in the browse.
Use the table in the browse. Do not join it in Clarion. Instead, use prop:sqlFilter ThisView{prop:sqlfilter} = ‘parentId in (select parentId from childtable)’
Carlos,
You can also use the aggregate functionality on the view to accomplish your distinct.
MyView VIEW(Article)
PROJECT(ART:COARTICLE)
PROJECT(ART:DARTICLE)
JOIN()
....
END
END
CODE
OPEN(MyView)
MyView('ART:COARTICLE', PROP:NAME} = 'DISTINCT A.COARTICLE'
This will replace the first column name with what you assign to prop:name. This allows you to do things like DISTINCT or TOP 10, etc.
Search in the help for aggregate
thanks for the information. I have read the help and I could with your example and looking at the debug I could understand why the “SQL Advanced” tab is used in the browse.