Vote count:
0
Any idea how can I change max(ID)+1 to select the highest auto increment value from wp_post table. I want to make sure I can choose equivalent of max(ID)+1
INSERT INTO wp_posts(ID, post_author, post_title, post_status, comment_status,post_type) VALUES ((SELECT max(ID)+1 FROM wp_posts),1,'name lastname', 'publish', 'closed', 'post_type');
Above query has an error, cos it's not possible to select max+1 from the same table where an INSERT statement is set up.
asked 30 secs ago
MySQL SELECT inside VALUE + max(ID)+1
Aucun commentaire:
Enregistrer un commentaire