Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL TIME Problem

Empfohlene Antworten

Veröffentlicht

Mal eine kleine MySQL Frage so zwischendurch:

habe folgende Tabelle:

+----------------+---------------+------+-----+------------+----------------+

| Field | Type | Null | Key | Default | Extra

|

+----------------+---------------+------+-----+------------+----------------+

| ID | bigint(20) | | PRI | NULL | auto_increment

|

| mitarbeiter_ID | varchar(20) | | | 0 |

|

| grund_ID | bigint(20) | | | 0 |

|

| aktivierung | enum('Y','N') | | | N |

|

| datum | date | | | 0000-00-00 |

|

| anfang | time | YES | | NULL |

|

| ende | time | YES | | NULL |

|

| text | text | YES | | NULL |

|

+----------------+---------------+------+-----+------------+----------------+

Möchte jetzt die Differnt von anfang und ende abfragen. Ungefähr so:

SELECT (ende - anfang) as gesamt from zeit limit 1;

+--------+

| gesamt |

+--------+

| 47793 |

+--------+

Tja nun sind aber anfang und ende beide vom Typ time (s.o.) daher hätte ich

auch gerne die Differnz als hh:mm:ss ausgegeben und nicht als INT - Wert.

Ich kann mir eigentlich nur vorstellen, dass ich hier ein großes Brett vor

dem Kopf habe. Die Lösung ist bestimmt sehr leicht. ich hoffe ihr könnt mir

helfen.

Danke

Lösung gefunden:

SELECT SEC_TO_TIME( (TIME_TO_SEC(ende) - TIME_TO_SEC(anfang)) ) AS gesamt FROM zeit LIMIT 1;

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.