Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このように選択カウントを挿入しようとしていますが、うまくいかないようです。
INSERT INTO vote (uid, pid, poid, yes, no, total) VALUES (:uid,:pid,:poid,0,0,(SELECT COUNT(*) FROM member WHERE pid = :pid2 AND type > 0))
さて、実際にはこれでうまくいきます。私は別の場所で間違いを犯しました。この作品。
これを試して:
INSERT INTO vote (uid, pid, poid, yes, no, total) SELECT :uid,:pid,:poid,0,0,COUNT(*) FROM member WHERE pid = :pid2 AND type > 0