How define query to filter

When i write Query = select from ezinfo$Referencias e
where in
(select d.cui from ezinfo$Dpi d)

or Query = select from ezinfo$Referencias e, ezinfo$Dpi d
where =

Does not work, how I define this under Query to use Table, GroupTable or whatever kind of tables ?

By default the Query = select e from ezinfo$Dpi e
and show data but I need show data about the attribute

Dear friend i resolve:

    private GroupDatasource<Referencias, UUID> referenciasesDs; 
    public void applyFilterReferencias(){ 
        try { 
            //referenciasesDs.setQuery("select r from ezinfo$Referencias r where =:" + dpiDs.getItem().getValue("id").toString()); 
            referenciasesDs.setQuery("select r from ezinfo$Referencias r where =:ds$"); 
        }catch (Exception ex){