You can mention versioning of the records of the phone numbers and see if newest version record
Main Topics
Browse All Topics I have 500 phone numbers stored in mysql database with their status.
For instance, if i a add new phone to the database. How do i get only new phone number added instead getting all phones.
Do we need to compare with all records and see or count the number os records in database and if no of records not equal how do we get the newly added phones.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
if u need to track newly added numbers then probably should be storing them in a different table
create a new table table for newly added numbers, and add new numbers to that.
once you have processed these new number and no longer consider them new numbers then they can be moved to your existing table.
Leaving the table of new numbers empty ready for insertion on more new numbers.
The table need to be designed well. Your table should have the following
1. An auto increment numeric column. This column be having values like 1,2,3,...... This column will get values automatically
2. Phone number
3. Status. I am not sure what you are storing in this column.
4. Date when phone added including timestamp.
5. A bit column that can have only 0 or 1 value. 1 means already processed or retrieved the phone number (meaning old one) and 0 means new one.
If you want to get all newly added phone numbers irrespective of status, just query the table with where condition on column 5. As soon as you get these newly added phone numbers, you need to update column 5 with '0' value so that the same phone numbers will not be retrieved again.
If you want to get all phone numbers during a day, query the table with column 4
You only really need two extra fields in the table for what you want:
createdDate,
lastUpdatedDate
If you want to keep a track of when entities are effective, a second table *could* be used.
id|effectiveFrom|effective
--------------------------
This would require ids be unique across the db for all entities
Business Accounts
Answer for Membership
by: CEHJPosted on 2006-09-06 at 09:36:23ID: 17464409
You should probably have an numeric id field too. Then to get the latest you could do
select phone from phones where id = max(id)