Solve this sql query

Below is a situation

I have two database table

1: Posts

2: Recent Watched

Now What I want is whenever user visits a certain post of mine, then it will make a new entry into recently watched table, through which i can see recently watched posts

Now The Problem is If my website hits reaches more than 200 k, then this table will be filled with no of records and ultimately will make my database very heavy

Now what I want is to delete the records from this table when it reaches certain limit automatically without any manual interference

Replies

  • The_Small_k
    The_Small_k
    A database trigger will do the work for you😛. Which will execute the query on database event(like every time when count(row) in my table reach 30 it will delete 10 records from it)👍.

You are reading an archived discussion.

Related Posts

Hi CEans, I had came over lots of places where I found that Women are more expressive about their thoughts,views,perceptions,etc. I want to stir up a debate on this topic...
Hewlett Packard or HP has recently launched its latest laptop the Chromebook 14 which will be known for featuring the 4th generation Dual-Core 1.1 GHz Intel Haswell processor. Alongside HP...
There are no examples of wheels in biological systems. One would think that gears would be even less likely. However, researchers have discovered a gear mechanism in a jumping insect....
IgNobel Prizes are given for whacky research. This years prize goes to a truly whacky invention any CEan can be proud of. It is for an antihijacking device. What is...
When Apple introduced the iPhone 5 Touch ID, we went ga-ga over the innovation that the company had brought to smartphones. Well, here some news that is sure to baffle...