Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL Union, Group By and Sum question
I have the following UNION ALL SQL which creates a record that contains fields from two other tables. Now I want unique custno, column2, column3, and sum on column4, column5 and column6. In the UNION ALL I could not see how to say "INTO" so that I could assign a cursor name. Also, my Union All fields had some '**' in some columns. What are the astericks?
Select custno, disb_rt_no, disb_ddano, disb_dda.disbddaamt, ;
0.00, 0.00 From disb_dda ;
Union All ;
Select custno, pmt_rt_no, pmt_dda_no, 0.00, prin_pmt, int_pmt From payment
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement