多表查詢 房地產

2021-09-26 15:44:31 字數 1951 閱讀 2600

t_community

create table

create table `t_community` (

`id` int(111) not null auto_increment,

`name` varchar(25) collate utf8_bin default null comment '小區名稱',

`street` varchar(45) collate utf8_bin default null comment '街道',

`room_name` varchar(1) collate utf8_bin default null comment '房間號abcd',

`flats_id` int(11) default null comment '公寓id',

`status` int(1) default null comment '出租狀態,0未租',

`room_name` varchar(1) collate utf8_bin default null comment '房間號abcd',

`flats_id` int(11) default null comment '公寓id',

`status` int(1) default null comment '出租狀態,0未租',

primary key (`id`)

) engine=innodb auto_increment=8 default charset=utf8 collate=utf8_bin

結果:

select

tf.flat_num as "公寓編號",

count(case when tr.`status` = 0 then tr.id end) as "未出租數量",

count(tr.id) as "該公寓所有房間數量",

(case when tf.is_private = 1 then '是' else '否' end) as "公寓是否是自營",

concat(tc.`name`, '-', tc.street) as "小區位址"

from

t_flats tf

left join t_community tc on (tf.community_id = tc.id)

left join t_room tr on (tr.flats_id = tf.id)

group by

tf.flat_num;

結果圖示:

別無選擇,唯有房地產 如何投資房地產

著名的股評家查德 羅素說過這樣一段話無論你是正從事哪一行,無論你正在起點如何,只要你還敢做夢 夢想自己成為有錢人,希望過上富足生活 那麼,你就一定要看看 理想的生意 他寫的所有股評文章的影響力都比不過這篇談論如何判定一門生意是否值得做的短文。如今,這篇文章已經被視為微型經典,在西方商業世界被廣為傳誦...

泡沫定義,房地產泡沫

在經濟學裡,影響最大的泡沫定義是以研究金融危機著稱的經濟學家金德爾博格 kindleberger 在 新帕爾格雷夫經濟學大詞典 中給出的 泡沫狀態 這個詞,隨便一點說,就是一種或一系列資產在乙個連續過程中陡然漲價,開始的 上公升會使人們產生出還要漲價的預期,於是又吸引了新的買主 這些人一般只是想通過...

房地產行業指導方案

2020年伊始,受新冠疫情影響,房企銷售均價普遍下滑,房地產行業陷入市場低迷階段。隨著疫情的平穩,房地產投資和銷售市場正逐漸復甦,並借助線上營銷迸發出新的活力,再現線上營銷在房產領域的巨大能量。房地產行業常用的獲取使用者渠道主要有 簡訊邀約 簡訊營銷 線下 廣告 傳單 戶外海報或大屏廣告等 線下活動...