时间:2021-07-01 10:21:17 帮助过:5人阅读
SELECT fang_time, city_name, IF(area is NULL,0,area), IF(taoshu is NULL,0,taoshu) FROM f_city AS fc LEFT JOIN (SELECT * FROM f_chengjiao ORDER by fang_time DESC) AS fcj USING (city_id) GROUP BY fc.city_id
SELECT fang_time, city_name, IF(AREA IS NULL,0,AREA) AS arra, IF(taoshu IS NULL,0,taoshu) AS taoshu
FROM f_city AS fc INNER JOIN
(SELECT * FROM f_chengjiao ORDER BY fang_time DESC) AS fcj
USING (city_id) ORDER BY fcj.fang_time DESC
你要的是不是这样的,如果不是欢迎追问。
SELECT fang_time, city_name, IF(AREA IS NULL,0,AREA) AS arra, IF(taoshu IS NULL,0,taoshu) AS taoshu
FROM f_city AS fc INNER JOIN
(SELECT * FROM f_chengjiao ORDER BY fang_time DESC) AS fcj
USING (city_id) ORDER BY fcj.fang_time DESC
你要的是不是这样的,如果不是欢迎追问。