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