MartinK: SQL-Befehl

Beitrag lesen

Hi,

In einer bestehenden Tabelle (hat noch keine Einträge) würde ich gerne den Datentyp TIME so definieren, dass man über hundert stunden eingeben kann (z.B. 178:35:00), wie ist das möglich?

Ist es.

Auszug aus der MySQL-Doku:

MySQL retrieves and displays TIME values in 'HH:MM:SS' format (or 'HHH:MM:SS' format for large hours values). TIME values may range from '-838:59:59' to '838:59:59'. The reason the hours part may be so large is that the TIME type may be used not only to represent a time of day (which must be less than 24 hours), but also elapsed time or a time interval between two events (which may be much greater than 24 hours, or even negative).

Sollte somit kein Problem darstellen, wenn der Wert nicht über 838 h und ein paar zerquetschte geht. Wenn doch:

Values that lie outside the TIME range but are otherwise legal are clipped to the appropriate endpoint of the range. For example, '-850:00:00' and '850:00:00' are converted to '-838:59:59' and '838:59:59'.

Hoffe, das war, was du gesucht hast.

Liebe Gruesse aus Österreich
Martin