Ver Mensaje Individual
  #1  
Viejo 06/01/09, 11:12:20
acontreras acontreras is offline
Junior Member
 
Fecha de Ingreso: oct 2008
Mensajes: 16
Optimizar Select

Miren en el trabajo me pidieron optimizar unos select reemplazando los for all entries por unos inner join. Tengo dudas en como utilizar el inner join y que datos poner en el select en vez de *. El código es el siguiente:

SELECT * INTO CORRESPONDING FIELDS OF TABLE t_ekko
FROM ekko
WHERE ebeln IN ebeln
AND kdatb IN s_kdatb
AND kdate IN s_kdate .

SELECT * INTO CORRESPONDING FIELDS OF TABLE t_ekpo
FROM ekpo
FOR ALL ENTRIES IN t_ekko
WHERE ebeln EQ t_ekko-ebeln .

select * into corresponding fields of table i_eban
from eban
for all entries in t_ekpo
where banfn eq t_ekpo-banfn
and bnfpo eq t_ekpo-bnfpo
and banfn in banfn
and werks in werks
and bsart in bsart
and badat in badat
and ekgrp in ekgrp
and ebeln in ebeln
and bedat in bedat
and konnr in konnr.

Espero me puedan ayudar
Responder Con Cita