2

I have about 20 entires (rows) in my db with matching id's, is there any query I can do that will merge the rows if the id is the same?

luckily there is no chance that a cell will replace each other, they will simply need to merge.

eg..

id    c1    c2    c3    c4    c5    c6    c7    c8    c9    c10

3     1
3           4           3 
1
  • I can think of a few programmatic approaches - are you using this data in an application? If so, what language? Commented Feb 16, 2011 at 20:41

2 Answers 2

4

You just have to group using any grouping function

select  id,max(c1) as c1,max(c2) as c2,max(c3) as c3,...
from    [Table]
group by Id
Sign up to request clarification or add additional context in comments.

Comments

2
select group_concat(c1), group_concat(c2) ....

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.