Hello I m 取得格式成果
location1 2 4
location2 3 2
location3 0 0
location1 1 0
我怎么能够轻视结果,使零和0的回归不会显示出来? 感谢
......
这里是Mysql的问询,我不知道如何从我的SQL中把它搁置起来,因此我想使用PHP。
SELECT hotelas.name, hotelas.address, hotelas.city, hotelas.country, hotelas.hotel_id
AS hotelid,
COUNT( DISTINCT apart.apartman_id ) AS number_of_free_ap,
COUNT( DISTINCT room.apartman_id ) AS num_of_free_rooms
FROM hotel AS hotelas
LEFT JOIN apartman AS apart ON ( apart.apartman_hotel = hotelas.hotel_id
AND apart.occupied =0
AND apart.what =1 )
LEFT JOIN apartman AS room ON ( room.apartman_hotel = hotelas.hotel_id
AND room.occupied =0
AND room.what =0 )
GROUP BY hotelas.hotel_id
TABLE 介绍:0 - 房间1 - 公寓
因此,我有几栏,其中最重要的一栏是一栏、自由房间和自由公寓。 因此,我有一个完整的0个房间和0个公寓的测试旅馆,我希望从名单上删除,因为所有其他旅馆至少有一个房间或一个公寓。