how to update count total in each id during the myql update query?

This forum is for Database developer ( PostgreSQL, MySQL, SQL Server, Oracle etc...) and database Administrator
mohit123
Posts: 162
Joined: Sat Sep 20, 2014 11:29 pm
Contact:

how to update count total in each id during the myql update query?

Postby mohit123 » Sat Sep 19, 2015 4:22 pm

how to update count total in each id during the myql update query?

I have to count the total post and need to add it in unique topic id. How i can update it correctly in mysql?

i want to counrt number of post num and want to add it in total topic.

UPDATE phpbb_topics AS b INNER JOIN phpbb_posts AS g ON b.topic_id = g.topic_id AND b.forum_id = g.forum_id SET b.topic_total= g.post_num + 1 WHERE g.post_approved = '0'


Return to “PostgreSQL, MySQL, SQL Server, SQL,PL/SQL, TeraData Developer and DataBase Administration”

Who is online

Users browsing this forum: No registered users and 1 guest