MS ACCESS Subselect "At most one record can be returned by this subquery."

0

asked by anonymous 02.08.2017 / 17:18

1 answer

0

Fixed by adding to PK in order by.

(SELECT TOP 1 J.observacao " +
 " FROM tblPendenciaHistorico J " +
" INNER JOIN tblPendenciaPendenciaHistorico JH " +
   " ON J.historicoId = JH.pendenciaHistoricoId " +
" WHERE JH.pendenciaId = P.pendenciaId " +
" ORDER BY J.data DESC, J.historicoId DESC) AS historicoStatus" 
    
02.08.2017 / 20:37