mysqlでのsql文
下記の'←追加'と書いた部分を追加して実行しましたが、動いてくれません。
ご教授お願いします。
("SELECT
song.song_ID,
song.song_name,
song.song_name_yomi,
kashu.kashu,
ka2.kashu as kashu2,
ka3.kashu as kashu3,
ka4.kashu as kashu4,
ka5.kashu as kashu5,
ka6.kashu as kashu6,
ka7.kashu as kashu7,
ka8.kashu as kashu8,
ka9.kashu as kashu9,
ka10.kashu as kashu10,
kashu.kashu_yomi,
sakushi,
sakushi_yomi,
sakkyoku,
sakkyoku_yomi,
hennkyoku,
hennkyoku_yomi,
tie_up.tie_up,
ti2.tie_up as tie_up2
kashu_yomi, ←追加
ky2.kashu_yomi as kashu_yomi2 ←追加
FROM ((((((((((((((((
song
left JOIN kashu ON song.kashu_1_ID = kashu.kashu_ID)
left JOIN kashu_yomi ON song.kashu_1_ID = kashu.kashu_ID) ←追加
left JOIN kashu_yomi ky2 ON song.kashu_2_ID = ky2.kashu_ID) ←追加
left JOIN kashu ka2 ON song.kashu_2_ID = ka2.kashu_ID)
left JOIN kashu ka3 ON song.kashu_3_ID = ka3.kashu_ID)
left JOIN kashu ka4 ON song.kashu_4_ID = ka4.kashu_ID)
left JOIN kashu ka5 ON song.kashu_5_ID = ka5.kashu_ID)
left JOIN kashu ka6 ON song.kashu_6_ID = ka6.kashu_ID)
left JOIN kashu ka7 ON song.kashu_7_ID = ka7.kashu_ID)
left JOIN kashu ka8 ON song.kashu_8_ID = ka8.kashu_ID)
left JOIN kashu ka9 ON song.kashu_9_ID = ka9.kashu_ID)
left JOIN kashu ka10 ON song.kashu_10_ID = ka10.kashu_ID)
left JOIN sakushi ON song.sakushi_ID = sakushi.sakushi_ID)
left JOIN sakkyoku ON song.sakkyoku_ID = sakkyoku.sakkyoku_ID)
left JOIN hennkyoku ON song.hennkyoku_ID = hennkyoku.hennkyoku_ID)
left JOIN tie_up ON song.tie_up_1_ID = tie_up.tie_up_ID)
LEFT JOIN tie_up ti2 ON song.tie_up_2_ID = ti2.tie_up_ID where song_name like '%%'" ))
お礼
ただ馬鹿正直に検索するだけで、 このような方法を知りませんでした。 >>explain select(以下略 で結果を見て解釈し、必要なところにインデックスを設け 大幅に改善できました!! ありがとうございます!!
補足
お早いご回答ありがとうございます!! 早速参考にさせていただきます!!