PHP/MySQL - Splitting similar data to two tables and querying as a whole



Ok I am working on building my skills to convert my apps to LAMP (read
I'm a semi noob), and there was one part I was thinking of. If I
create two identical MySQL tables (we'll say, invoice and invoicearc)
one will hold current period data and the other will hod out of period
data - previous years stuff, which is only used in queries <5% of the
time at most.

Now can I join these two tables to make one table when doing queries
that span the current and prior periods. I've read of joins where you
are linking references, like primary and external keys, but not one
where you are bringing tables of the same structure into a larger
query. I've googled around a bit but cant find the right syntax to
find a yea or nay on if it is possible.

I know I could have mmassive tables and put all of this stuff in there,
but I was thinking I coud improve speed if I were able to just bring in
the archive data only when needed.

.



Relevant Pages

  • Re: Comparing contents - is it possible
    ... The set-based sql language was invented so we can avoid using ... cursors/loops to perform simple queries on data. ... > I delete all but the most recent transaction record for each invoice ... FROM Invoices IV INNER JOIN Tracking TR ...
    (microsoft.public.excel.programming)
  • RE: Passing info to a Report
    ... Be sure that the key field is in the queries ... procedure above to send the info to a report that I can then print out. ... If I select an invoice that's ...
    (microsoft.public.access.formscoding)
  • RE: Query stopped working after entry 615 in table
    ... the entries after Q26K02 is due to the size of the Tracking Table, ... There will only be one entry with this specific invoice number. ... Invoice Query brings up the data for that specific entry. ... The two queries are not joined. ...
    (microsoft.public.access.queries)
  • Re: Calculations in Tables
    ... It is pretty easy to change your forms and reports to be based off queries. ... It is a simple layout that includes an invoice table ... perform the calculations in your ...
    (microsoft.public.access.gettingstarted)
  • Help req. to install Vanilla to LAMP / cPanel
    ... I am a newbie and I need help trying to install Vanilla to LAMP / ... cPanel. ... If you have any queries or requests, ...
    (php.general)