我的选择查询输出如下
[0] => stdClass Object
(
[TicketPrice] => 80
[Grade] => O-1
)
[1] => stdClass Object
(
[TicketPrice] => 80
[Grade] => O-2
)
[2] => stdClass Object
(
[TicketPrice] => 80
[Grade] => O-3
)
[3] => stdClass Object
(
[TicketPrice] => 90
[Grade] => O-4
)
[4] => stdClass Object
(
[TicketPrice] => 70
[Grade] => O-5
)
[5] => stdClass Object
(
[TicketPrice] => 80
[Grade] => G-1
)
[6] => stdClass Object
(
[TicketPrice] => 90
[Grade] => G-2
)
[7] => stdClass Object
(
[TicketPrice] => 90
[Grade] => G-2
)
我需要输出就像我提到的
1.O-1到O-3价格是80 2.0-4是90 3.G-2到G-2的价格是90
答案 0 :(得分:0)
你喜欢这个,
SELECT TicketPrice, Grade FROM table_name WHERE [ conditions ] GROUP BY TicketPrice;