MySQL can do embedded SQL like that? I'm using 3.23. If so, can the embedded
query have a WHERE clause as well (something like WHERE datetime >
date_sub(NOW(), interval 1 month).

Thx a lot

----- Original Message -----
From: "gerald_clark" <[EMAIL PROTECTED]>
To: "Qmail List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, December 04, 2002 10:49 AM
Subject: Re: General question about rotating growing tables


> How about
> Create newtable select * from oldtable where conditions_are_met;
>
>
> Qmail List wrote:
>
> >Hello,
> >
> >I have a simple database schema with a table of log entries that grows
> >quickly. Every month I'd like to break last month's entries off into a
new
> >table for that (last) month. I know creating new tables within an
existing
> >schema is not recommend database design, but in this case it seems to
make
> >sense.
> >
> >I've used triggers and stroed procedures in Oracle to do this kind of
table
> >rotating and it was pretty simple.
> >
> >What I'm considering with MySQL is using Cron and the MySQL client app to
> >select the appropriate date range into an hash, write the hash into a
newly
> >created table, and then delete the selected rows from original table. My
> >question is, is this recommended logic, or is there a better way to skin
> >this cat using MySQL?
> >
> >
> > Sincerely, Eric
> >
> >
> >---------------------------------------------------------------------
> >Before posting, please check:
> >   http://www.mysql.com/manual.php   (the manual)
> >   http://lists.mysql.com/           (the list archive)
> >
> >To request this thread, e-mail <[EMAIL PROTECTED]>
> >To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
> >
> >
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to