SQLで次のようなクエリ文を実行しました。
コード SELECT identification_card.*, settlement.`name` as `payment_name`, settlement.`support_mail` as `payment_mail`, settlement.`support_tel` as `payment_tel`, settlement.`del_flg`, settle_selectable.`url,max(send_date)` FROM `identification_card` (select user_id,payment_id,max(send_date) from identification_card where user_id = 'shimadahoujin' and payment_id = '10005' group by user_id,payment_id) as max_table INNER JOIN `settlement` ON max_table.`payment_id` = settlement.`payment_id` INNER JOIN `settle_selectable` ON max_table.`payment_id` = settle_selectable.`payment_id` WHERE `identification_card`.`user_id` = 'shimadahoujin' AND `settlement`.`del_flg` = 0 GROUP BY `identification_card`.`payment_id`;
実行結果は
コード [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(select user_id,payment_id,max(send_date) from identification_card where user_id' at line 3
と出力され、文法に誤りがあると思うのですが、どこが間違っているのかわかりません。
ご教授お願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/08/23 05:29
2016/08/23 06:13