Hay un error: ERROR: column "ramos" does not exist LINE 25: ...hapublicacion >= '2019-05-26 06:22:52' ) AND n.idnota =ramos ^