0
SELECT `apt`.`id` as `aprtid`,
`apt`.`apt_no` as `aptno`,
`apt`.`core` as `aptcore`,
`apt`.`floor` as `aptfloor`,
`apt`.`bd_code` as `aptbuld`,
`bd`.`building_name` as `buldname`,
`rs`.`resident_name` as `rsdntname`,
`rs`.`resident_email` as `rsdntemail`,
`rs`.`resident_phone` as `rsdntphone`,
`rs`.`resident_pic` as `rsdntpic`
FROM `apartments` as `apt`
INNER JOIN `buildings` as `bd`
ON `bd`.`bd_code` = `apt`.`bd_code`
INNER JOIN `residents` as `rs`
ON `rs`.`apartment_no` = `apt`.`apt_no`
WHERE `apt`.`id` = '8'
ORDER BY `apt`.`id` DESC
當我使用此查詢它返回某種程度上acurate但與居民和公寓的情況下加入與它不匹配。 因爲我有匹配的居民和公寓我有相同的公寓沒有,但都有不同的建築物,但作爲一個輸出其返回我的結果如何可能我在這個查詢中做錯了。爲什麼我得到的結果我認爲和條件不起作用,但。多個加入與和,並返回錯誤的結果
u能請更新我的代碼? – Arushi
我需要一個查詢條件爲multijoin – Arushi