无法根据其类别制作无序列表

时间:2017-10-05 05:09:50

标签: mysql

表格如下:

enter image description here

category_amenities表如下:

enter image description here

我提出了这个问题:

`SELECT amenities.subcategory from amenities inner join category_amenities 
on amenities.category=category_amenities.name 
where amenities.category= 
(select distinct category_amenities.name from category_amenities 
inner join amenities on category_amenities.name = amenities.category where category_amenities.name = 'Parking');`

然后我得到了这个输出:

Facilities
   Street Parking
   Bus Parking
   Complimentary Parking
   Paid Parking
   Valet Parking
Parking
 Street Parking
 Bus Parking
 Complimentary Parking
 Paid Parking
 Valet Parking

请告诉我如何获得如下输出:

 Facilities
   Onsite restaurant

Parking
   Street Parking
   Bus Parking
   Complimentary Parking
   Paid Parking
   Valet Parking

我需要更正上面的查询。

0 个答案:

没有答案