Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL SELECT MAX IN WHERE CLAUSE

2890292Mar 4 2016 — edited Mar 4 2016

Hello team.

I would like and appreciate your help with an inquiry regarding a SQL statment that is retrieving all the records and not the max value of this specific record wanted.

Below i write you the sql sentence waiting in your side.

SELECT son.CCTCONTACTO_ID,

   son.CCTREGCONTACTO\_ID,

   son.CORREOELECTRONICO,

   son.ID,

   son.NOMBRE,

   son.NUMEROTELEFONO,

   son.ROBO\_ID,

   ton.DESCRIPCION,

   ton.ID AS ID1

FROM CONTACTO son, CCTCONTACTO ton

WHERE (son.ROBO_ID=8786 AND son.CCTCONTACTO_ID = ton.ID AND ton.DESCRIPCION = 'REPORTE') AND (son.ID=(SELECT MAX(ID) FROM CONTACTO WHERE ID=son.ID));

Regards.

screenshoot.jpg

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2016
Added on Mar 4 2016
6 comments
7,411 views