Jump to content

Problem using GROUP_CONCAT


Shadowing

Recommended Posts

Hey guys having issues trying to get group_concat to work. If its even what im looking for :P

 

All these columns are INT accept bombers which is a string

What I want to do is also add each bombers columns with a - seperator

 

 

"SELECT SUM(naqahdah) , COUNT(*) , SUM(slaves) , SUM(jaffa) , SUM(unas) ,  

  SUM(resources) , SUM(death_gliders), SUM(threaders) , GROUP_CONCAT(bombers separator '-') , 

  SUM(staff_cannons) , SUM(naqahdah_mines) FROM planets WHERE id= $user_id GROUP BY id";

 

 

 

If anyone could kindly help

Link to comment
https://forums.phpfreaks.com/topic/276722-problem-using-group_concat/
Share on other sites

I'm unsure where your confusion lies Barand

 

 

I need mysql to return in the same pattern when all bombers rows are being added together

 

so

bombers row1 looks like  '50-6-7-8-3-4-5'

bombers row2 looks like '50-6-7-8-3-4-5'

bombers row3 looks like '50-6-7-8-3-4-5'

 

i need the return to be '50-6-7-8-3-4-5-50-6-7-8-3-4-5-50-6-7-8-3-4-5'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.