Beginner

276. SECOND Function

Learn how to extract the seconds component from a time or timestamp.

📘 Lesson 276 of 728 ⏱ 8 min 🎯 Intermediate

The SECOND function extracts the seconds component from a time or timestamp value.

Second-level information can be useful when analyzing precise transaction events and system activity.

Extract the seconds from a transaction timestamp.

SQL
SELECT
    TransactionID,
    SECOND(TransactionTime) AS TransactionSecond
FROM Transactions;

SECOND can support application logging, transaction monitoring, system event analysis, and detailed operational reporting.

  • SECOND extracts the seconds component.
  • The value is normally between 0 and 59.
  • It works with time or timestamp values.
  • It supports detailed time analysis.
  • Database implementations may differ.
What does SECOND return?

SECOND returns the seconds component from a time or timestamp.

Where can SECOND be useful?

It can be useful for detailed event timing, transaction monitoring, and system log analysis.

Have you finished this lesson?

Introduction to SQL – All Lessons