Complex mysql selection
I tried to produce the same ordering and having some trouble
but here are two different queries you can start with:

SELECT
    booki_id,bet_id,bettype,
    group_concat(odds order by bet) betodds,line
FROM
    bettable
GROUP BY
    booki_id,bet_id,bettype,line
;

SELECT * FROM
(
    SELECT
        booki_id,bet_id,bettype,
        group_concat(odds order by bet) betodds,line
    FROM
        bettable
    GROUP BY
        booki_id,bet_id,bettype,line
) AA
ORDER BY betodds
;


I also created sample data to test it with, and here it is:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.12 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

MySQL (Current test) :: use test
Database changed
MySQL (Current test) :: DROP TABLE IF EXISTS bettable;
Query OK, 0 rows affected (0.03 sec)

MySQL (Current test) :: CREATE TABLE bettable
    -&gt; (
    -&gt;     id       INT NOT NULL AUTO_INCREMENT,
    -&gt;     booki_id INT,
    -&gt;     bet_id   INT,
    -&gt;     bet      INT,
    -&gt;     bettype  VARCHAR(10),
    -&gt;     line     FLOAT,
    -&gt;     odds     FLOAT,
    -&gt;     PRIMARY KEY (id)
    -&gt; );
Query OK, 0 rows affected (0.05 sec)

MySQL (Current test) :: INSERT INTO bettable (booki_id,bet_id,bet,bettype,line,odds) VALUES
    -&gt; (123,321,1,'3way',0.0,2.3),
    -&gt; (123,321,2,'3way',0.0,3.4),
    -&gt; (123,322,1,'3way',0.0,1.1),
    -&gt; (123,322,2,'3way',0.0,7.4),
    -&gt; (123,323,1,'3way',0.0,1.3),
    -&gt; (123,323,2,'3way',0.0,9.4);
Query OK, 6 rows affected (0.02 sec)
Records: 6  Duplicates: 0  Warnings: 0

MySQL (Current test) :: SELECT
    -&gt;     booki_id,bet_id,bettype,
    -&gt;     group_concat(odds order by bet) betodds,line
    -&gt; FROM
    -&gt;     bettable
    -&gt; GROUP BY
    -&gt;     booki_id,bet_id,bettype,line
    -&gt; ;
+----------+--------+---------+---------+------+
| booki_id | bet_id | bettype | betodds | line |
+----------+--------+---------+---------+------+
|      123 |    321 | 3way    | 2.3,3.4 |    0 |
|      123 |    322 | 3way    | 1.1,7.4 |    0 |
|      123 |    323 | 3way    | 1.3,9.4 |    0 |
+----------+--------+---------+---------+------+
3 rows in set (0.01 sec)

MySQL (Current test) :: SELECT * FROM
    -&gt; (
    -&gt;     SELECT
    -&gt;         booki_id,bet_id,bettype,
    -&gt;         group_concat(odds order by bet) betodds,line
    -&gt;     FROM
    -&gt;         bettable
    -&gt;     GROUP BY
    -&gt;         booki_id,bet_id,bettype,line
    -&gt; ) AA
    -&gt; ORDER BY betodds
    -&gt; ;
+----------+--------+---------+---------+------+
| booki_id | bet_id | bettype | betodds | line |
+----------+--------+---------+---------+------+
|      123 |    322 | 3way    | 1.1,7.4 |    0 |
|      123 |    323 | 3way    | 1.3,9.4 |    0 |
|      123 |    321 | 3way    | 2.3,3.4 |    0 |
+----------+--------+---------+---------+------+
3 rows in set (0.02 sec)

MySQL (Current test) ::


You will have to play with the order of the whole rows from here.

Give it a Try !!!