Home » Performance » MySQL » UNION question
UNION question [message #3207] Thu, 19 June 2008 19:02
rmarshsj  is currently offline rmarshsj
Messages: 1
Registered: June 2008
Junior Member
Hi All,

I am creating a temporary table which is the union of three selects each producing an ID and a score. If I use UNION on its own I lose any duplicated rows. If I use UNION ALL I get some rows with the same ID but different scores. What I want instead is to end up with unique IDs with the score column being the sum of the scores for any duplicate rows. Is this possible? Does anyone have any suggestions?

Thank you,

Rob

Read Message
Previous Topic:Call sql script from sql script
Next Topic:Help Me optimize my query
Goto Forum:

  



Current Time: Mon Dec 1 12:38:04 EST 2008

Total time taken to generate the page: 0.00546 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge