SELECT daire.code, daire.durumu, daire.blblkodu, CONCAT(cari.adi , cari.soyadi) AS sahibi,
CASE daire.blkrcrkodu WHEN '0'
THEN CONCAT(cari.adi,cari.soyadi)
ELSE (SELECT CONCAT(adi,soyadi)
FROM cari
WHERE blkodu = daire.blkrcrkodu
AND firma_code = 40
AND site_code = 84) END AS oturan,
daire.kat, daire.kapi_no, daire.giris_no, daire.alan_m2, daire.__formatted_date
FROM daire
INNER JOIN cari ON
(daire.blshcrkodu = cari.blkodu AND cari.site_code = 84 AND daire.site_code = 84)
WHERE daire.site_code = 84
AND daire.firma_code = 40
ORDER BY daire.blkodu DESC
構文エラーがありますか? 何が問題なのかわからないのですが、助けてもらえますか?