Re: Elaborare query con molti record

Davide Rossi <[email protected]>
Newsgroups gmane.comp.cms.cold-fusion.devel.italian
Message-ID <CAJj9Egu+qg+MWb=T1wMoxY0OyjkKmdPXzA64c+uY4rxX7sXkGA@mail.gmail.com>
Puoi provare questa soluzione di cui ti accennavo prima e ora posso darti
una info + precisa:

*INSERT INTO ORDINI_DELETED*
           (ORDD_anno, ORDD_num)
SELECT     ORDERS.ORD_anno, ORD.Ordini_num
FROM       ORDERS *LEFT OUTER JOIN*
*           ORDERSDETAILS* ON ORDERS.ORD_id = ORDERSDETAILS.ORD_id
WHERE     (*ORDERSDETAILS.ORD_KK IS NULL*)

*(in altre parole , se schematizzi, ottieni i non esistenti a destra*)



oppure puoi provare una soluzione più avanzata dove, prima di fare la
insert fai anche delle elaborazioni dei valori applicando delle formule
aggiuntive, oppure delle ulteriori query di calcolo o chiamate a funzioni,
come segue:

INSERT INTO ORDINI_DELETED
           (ORDD_anno, ORDD_num)
SELECT   *  (ORDERS.ORD_anno * calcolivari) AS ORD_anno*, *(ORDINI.ORD_num
+ varie) AS ORD_num*
FROM       ORDERS LEFT OUTER JOIN
           ORDERSDETAILS ON ORDERS.ORD_id = ORDERSDETAILS.ORD_id
WHERE     (ORDERSDETAILS.ORD_KKK IS NULL)


Se hai bisogno di più info, invia, maggiori info :-)

Ciao
Buona serata
Davide


Il giorno 23 aprile 2012 21:31, Roberto Marzialetti <[email protected]
> ha scritto:

> **
>
>
> io invece ti spiego come si usano quelle stringhe
> che iniziano con "<" e finiscono con questo ">"  :-D
>
> viva i file txt, naturalmente :-D
>
>
>
> Il giorno 23 aprile 2012 21:26, Emanuele Cellini <
> [email protected]> ha scritto:
>
>>
>>
>> Ciao Roberto,
>>
>> in data lunedì 23 aprile 2012, alle ore 18.16, hai scritto:
>>
>>
>>
>>
>> minchia bello non ci avevo mai pensato
>> grazie :-)
>>
>> Ma fai davvero??!?!?!
>>
>> Se proprio un programmatore alle prime armi :)
>>
>> Quando ci vediamo ti spiego la differenza tra un file txt e un DB
>> relazionale :D
>>
>> Ciao
>>
>>
>>
>> *--
>> I migliori saluti,                        Scrivi a:
>>  Emanuele                                *[email protected]
>>
>>
>
>
> --
> Roberto Marzialetti
> webdeveloper
> m. 329 0681847
>
>  
>



-- 
*Davide Rossi
*Software development | Ambergris s.r.l. | Contech s.a.s.
*Soluzioni web per il turismo. Consulta la Brochure
AmberOne<http://touroperator.ambergris.it/>

  <http://www.ambergris.it/>    <http://www.contechnet.it/>
*
* *+39 06.9896.0845* - *335.8182.229* -  *+39 06.233.14504 -  internew


  Rispetta l'ambiente: se non è necessario, non stampare questa mail

REDUCE - Print only when necessary. *REUSE *- Turn unneeded print-outs into
scrap paper. *RECYCLE *- Recycle when you're through
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.