Welcome to Sign in | Help

Re: Problema cu ultimele inregistrari

  •  04-16-2008, 9:12 PM

    Re: Problema cu ultimele inregistrari

    Incearca sa pui nolock la tabele.

    Incearca sa scapi de conditia where .... pk_key =(SELECT MAX(pk_key) as pk_key FROM tabel t2 WHERE t1.cod = t2.cod AND t2.data <= data) printr-un join intre t1 si t2

    ceva de genul:

    SELECT t1.cod, t1.sold, SUBSTRING(t1.cod,3,4) as grupa FROM tabel t1 (nolock)

    join (SELECT MAX(pk_key) as pk_key FROM tabel t2(nolock) WHERE t1.cod = t2.cod AND t2.data <= data) xt on t1.pk_key = xt.pk_key

    Nu am testat join-ul asta, dar stiu sigur ca ajuta la performnta.

     

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems