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 `js_hdr`(`JO_NO`) SELECT MAX(`JO_NO`) + 1 from `js_hdr`
但是当我添加列时,它不起作用,如下所示:
INSERT INTO `js_hdr`(`TRAN_NO`,`JO_NO`) '1', SELECT MAX(`JO_NO`) + 1 from `js_hdr`
先感谢您。我正在使用 Mysql
尝试通过删除'1',并将其放入SELECT
'1',
SELECT
INSERT INTO `js_hdr`(`TRAN_NO`,`JO_NO`) SELECT '1',MAX(`JO_NO`) + 1 from `js_hdr`