I have the following sql, but at the present time can not convert this.
I stopped just at the limit of the subselect. Can anyone help me?

```
select( select p2.numnfe from xml_itens as p2
where p2.cod_prod_cli is null
and p2.ean_prod = p1.ean_prod
and p2.cnpj_for = p1.cnpj_for
and p2.cod_prod_for = p1.cod_prod_for
and p2.cfop != 5929 and 6929
LIMIT 1
) as num_nfe,
(SELECT descricao_prod from xml_itens as p2
where p2.cod_prod_cli is null
and p2.ean_prod = p1.ean_prod
and p2.cnpj_for = p1.cnpj_for
and p2.cod_prod_for = p1.cod_prod_for
and p2.cfop != 5929 and 6929
LIMIT 1
) as descricao_prod, 
cnpj_for, ean_prod, cod_prod_for, cod_prod_cli
from xml_itens as p1 
where cod_prod_cli is null
and p1.cfop != 5929 and 6929 
group by cnpj_for, ean_prod, cod_prod_for;

```

I managed to do it, but caught in time to return only one record from the database.

```
 String sql = "select ("
            + " select p2.numnfe from XmlItens p2 where p2.codProdCli is null and p2.eanProd = p1.eanProd and p2.cnpjFor = p1.cnpjFor and p2.cfop != 5929 and p2.cfop != 6929) as numnfe, "
            + " p1.cnpjFor, p1.eanProd, p1.codProdFor from XmlItens p1 "
            + " where p1.codProdCli is null "
            + " group by p1.cnpjFor, p1.eanProd, p1.codProdFor";

```

Thanks