General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only