Title: Sintax problem
Last modified: August 21, 2016

---

# Sintax problem

 *  Resolved [lododicesimo](https://wordpress.org/support/users/lododicesimo/)
 * (@lododicesimo)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sintax-problem/)
 * Hello. I have a website with a custom post type (alunni).
    i have to rotate all
   the category one time a year..
 * Like a Shift rotate of the category (they are 6)
 * So i have find a sql code that move all the post that are in a category to another
   and works. so i have to do 5 command to move all post and hava the first category
   empty.
 * the code i use is like:
 * UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ’10’
   WHERE wp_term_relationships.term_taxonomy_id = 8 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
 * if i put all 5 code the plugin said that i have sintax error, so i have to do
   all the code one for one.. here is what i have to do:
 * UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ’10’
   WHERE wp_term_relationships.term_taxonomy_id = 8 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
   
   UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ‘8’ 
   WHERE wp_term_relationships.term_taxonomy_id = 7 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
   UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ‘7’ 
   WHERE wp_term_relationships.term_taxonomy_id = 6 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
   UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ‘6’ 
   WHERE wp_term_relationships.term_taxonomy_id = 5 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
   UPDATE wp_term_relationships SET wp_term_relationships.term_taxonomy_id= ‘5’ 
   WHERE wp_term_relationships.term_taxonomy_id = 4 AND EXISTS (SELECT * FROM wp_posts
   AS A1 WHERE A1.ID = wp_term_relationships.object_id AND A1.post_type = “alunni”);
 * where is the error?
    thanks
 * [https://wordpress.org/plugins/dbview/](https://wordpress.org/plugins/dbview/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [john ackers](https://wordpress.org/support/users/john-ackers/)
 * (@john-ackers)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/sintax-problem/#post-4905381)
 * dbview is only intended to display database data in a table. You can execute 
   inserts, updates, and deletes but you can only execute one SQL statement in each
   dbview not five. Sorry.

Viewing 1 replies (of 1 total)

The topic ‘Sintax problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dbview.svg)
 * [dbview](https://wordpress.org/plugins/dbview/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dbview/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dbview/)
 * [Active Topics](https://wordpress.org/support/plugin/dbview/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dbview/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dbview/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [john ackers](https://wordpress.org/support/users/john-ackers/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/sintax-problem/#post-4905381)
 * Status: resolved