0

Hi to everyone,

I am working in xml feed parsing section.In my database table structure is shown like this:

Display image Here my needs is every sponsor are placed in single row not in multiple columns. For example :

   bookmaker_quote      scommessatipo_quote       q_1     q_2    q_3

    PINNACLE              1x2                     6.47    4.31   1.60
    BETCLICK              1x2                     5.80    2.25   2.15
    PADDYPOWER            UNDER/OVER 3.5          1.36    3.25   -

I want to show quotavalore_quote values comes under single rows

How to show above table format using mysql query?

Updated

i show using group concat

SELECT distinct(bookmaker_quote) as bb ,group_concat(quotavalore_quote) as aa  FROM `quote`  where id_odds=10 

this is result for group concat

bb           aa 

PINNACLE    6.47,4.31,1.60,5.80,2.25,2.15,11.00,1.03,3.80,1.25...

I get only one sponsor values , but i need to get all sponsor values..How to get this.......Please guide me..

user2711066
  • 169
  • 2
  • 2
  • 10
  • it called transposing, mysql has no built-in function for it, here are some links that should point you in the right direction: [link](http://stackoverflow.com/questions/14619678/mysql-transpose-pivot-row-to-column-variable-selects), [link2](http://stackoverflow.com/questions/16568228/how-to-transpose-mysql-table-rows-into-columns) – gwillie Sep 28 '13 at 06:35

1 Answers1

0

You can turn rows into a column with GROUP_CONCAT function. Try with that.

Satheesh
  • 399
  • 2
  • 5
  • 11