MySQL Forums
Forum List  »  Triggers

Re: Need help creating a trigger
Posted by: Vikram Shityalkar
Date: December 24, 2008 04:44AM

try this,

create trigger recalc_post_count after insert on posting
decalre ver INT
select count(*) INTO ver from posting where thread_id = new.thread_id;
update thread set post_count = ver where thread_id = new.thread_id;

Options: ReplyQuote


Subject
Views
Written By
Posted
3632
November 17, 2008 02:34PM
2076
November 17, 2008 04:57PM
Re: Need help creating a trigger
2005
December 24, 2008 04:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.