I'm not an SQL guy, so it would probably take me an hour or so to figure
this out. I'm sure this is simple if you work with SQL. Here's what I need:
Every day, our DB gets updated with daily info about items.
So today, for example, the last entries might look like this:
tablename: 2009_october_data
date item info
---------- ---- ----
2009-10-07 xxx foo
2009-10-07 xxy bar
2009-10-07 xxz dee
This db gets appended to daily, so yesterday for example, the last entries might have look something like this:
tablename: 2009_october_data
date item info
---------- ---- ----
2009-10-06 xxt goo
2009-10-06 xxx gee
2009-10-06 xxz haw
Notice that yesterday (2009-10-06), the item "xxy" was NOT yet in the db. Also, notice that while item "xxt" was in the db yesterday (2009-10-06), it is not in the db today (2009-10-07).
What I need is 2 SQL queries:
1. one that retrieves the list of "new" items that appeared today, but were not in the db yesterday.
2. one that retrieves the list of "deleted" items that appeared yesterday, but are not in the db today.
Thanks in advance!