PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > Find date and time of last update
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Find date and time of last update

Réponse
 
LinkBack Outils de la discussion
Vieux 07/04/2006, 12h24   #1
Hieronimus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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?

  Réponse avec citation
Vieux 07/04/2006, 14h13   #2
onedbguru@firstdbasource.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

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.

  Réponse avec citation
Vieux 07/04/2006, 14h30   #3
Jeff North
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

On 7 Apr 2006 04:24:33 -0700, in mailing.database.mysql "Hieronimus"
<rui.pacheco@gmail.com>
<1144409073.740963.301310@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
---------------------------------------------------------------
  Réponse avec citation
Vieux 07/04/2006, 14h32   #4
Hieronimus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

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.

  Réponse avec citation
Vieux 07/04/2006, 16h51   #5
onedbguru@firstdbasource.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

Mighty testy for someone who is asking for ...

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.

  Réponse avec citation
Vieux 10/04/2006, 10h36   #6
Hieronimus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

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.

  Réponse avec citation
Vieux 10/04/2006, 16h59   #7
onedbguru@firstdbasource.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

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)

  Réponse avec citation
Vieux 10/04/2006, 18h00   #8
Bill Karwin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find date and time of last update

onedbguru@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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h08.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13836 seconds with 16 queries