473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Find date and time of last update

Hi all

I inherited a server running MySQL 4.* from a previous developer. Now,
the records on this database might be what I want, or they might just
be test data. I think my only chance of finding out if this is the real
thing is to find the date and time of the last insert into the
database.

How can I do that?

Apr 7 '06 #1
7 14910
select max(datefieldnamehere) from table;

Sounds like a good SQL for beginners would be a very good place to
start. The Dummy series is a great for beginners.

Apr 7 '06 #2
On 7 Apr 2006 04:24:33 -0700, in mailing.database.mysql "Hieronimus"
<ru*********@gmail.com>
<11**********************@i39g2000cwa.googlegroups .com> wrote:
| Hi all
|
| I inherited a server running MySQL 4.* from a previous developer. Now,
| the records on this database might be what I want, or they might just
| be test data. I think my only chance of finding out if this is the real
| thing is to find the date and time of the last insert into the
| database.
|
| How can I do that?


show table status;
---------------------------------------------------------------
I often wish that email had never been invented, but there’s
just no way I can get rid of it. So, day after day, several times
a day, I dutifully delete 99% of the emails I receive, and when
I’m not able to get at my email for a few days, I’ll leave the
machine at home running to pick it up every 10 minutes so I don’t
overflow some capacity somewhere, and just the other day I caught
myself wondering who will clean out my Inbox after I’m dead.

Charles Petzold. October 20, 2005
---------------------------------------------------------------
Apr 7 '06 #3
I have no date field. I have varchar's and a couple of booleans, but no
date field.
Why did you assume I had a datefield? I never mentioned it anywhere.

Apr 7 '06 #4
Mighty testy for someone who is asking for help...

1) if there is no DATE field (either some date/time datatype OR a
char/varchar field with date data) then show table status. BTW, most
other database engines require auditing or a date field to determine
last update times. You got lucky here....

2) methods of finding maximum values
select max(datefieldnamehere) from table;
select max(cast(char_datefieldnamehere as date)) from table;

Again, see No 1 if these do not apply.

Apr 7 '06 #5
Ah, yes, the audit field. Someone else has just pointed me to something
like that. I'll include one for every table I create.
Another thing, I didn't mean to be too smart, but you called me a moron
without knowing anything about me. It didn't feel right, too.

Apr 10 '06 #6
I do not see anything in my post that would suggests that a beginner
in this field is a moron. After having been in a support role for many
years, purchased the "SQL for Dummies" book and added it to my
reference library. This was many years ago, but still have a need to
reference it on occasion as I cannot remember every nuance that is
articulated in that book and other very fine reference materials. To
suggest that someone add this book (or series of books) to their
reference library in no way suggest that the indiviual is " a moron".
I have also found that, in general, the Dummy series to be very
informative in other aspects of the IT world. There are other very
good resources on the market as well - but I never seem to recall the
titles of those books. :)

Regards,

A DBA for > 16 years and IT in general > 25 yrs. (field service,
consulting and others)

Apr 10 '06 #7
on*******@firstdbasource.com wrote:
I do not see anything in my post that would suggests that a beginner
in this field is a moron.


I've decided to stop recommending "SQL for Dummies". It's a good book
that is useful to people at various levels of experience, but many
people quite understandably get the wrong message when one recommends it
as a book they should read.

Regards,
Bill K.
Apr 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ric | last post by:
I am using crystal reports to attempt to extract information from this database but I need to know which records were last updated. I have managed to find a field in Oracle and its value is based...
4
by: Ike | last post by:
Is there a way in mysql to discern when the last date/time a field, row, or table was been updated or inserted? Thanks, ike
7
by: Jerome | last post by:
Hallo, I know a lot has already been told about date/time fields in a database but still confuses me, specif when dealing with SQLserver(Express). It seems that sqlserver only accepts the date in...
17
by: Franc Zabkar | last post by:
My D-Link DSL-302G modem/router has a real-time clock whose settings are volatile. To avoid hand keying the date/time via the modem's JS interface, I wonder if there is a way to copy the JS code to...
2
by: john | last post by:
From an Excel-import I have an access table with a datetime field of wich both date and time are entered. I've set the field's notation properties to Short Date. When I view the table in tableview...
3
by: MarcJoseph | last post by:
I have a database that is shared my multiple users who enter and update records on a weekly basis. Is there a way I can add a field to my main data table that will automatically generate the...
3
by: Cron | last post by:
Hi I'm trying to Dcount *unique* records by comparing a date/time field. I say *unique* because the field contains a date/time but I need to ignore the timestamp and work off the date only. I...
3
by: kate2272 | last post by:
Hi Guys, Thanks heaps for assisting with my last question. I would like to automatically update a new record with date / time but I was wondering if it is possible for it not to live update...
9
by: JeremyI | last post by:
I am writing code to import assessment information about a building from an Excel file (populated by a mobile interviewer on a laptop) into an Access database. With much trial and error, I've hit...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.