|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
how to insert results of two quries with counts into a new table.
i have field name 'name' in table1 and in table2
and also i have one numeric fiels in table 1 and also in another numeric field in table2 which is differant from that now i wnat to insert the result of the queris such as select sum(numericfield1) from table1 where distinct name select sum(numericfield2) from table2 where distinct name at the end the two name fields to be equal this entire data to be saved in a new table Last edited by bvrgsk : May 3rd, 2004 at 01:51 PM. Reason: to complete my question |
|
#2
|
|||
|
|||
|
Try
INSERT INTO emptytable(name,numericfield) SELECT name1, sum(numericfield1+numericfield2) FROM table1, table2 WHERE name1=name2 GROUP BY name1 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > how to insert results of two quries with counts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|