• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

MySQL Command: MINUTE()

December 20, 2023

MySQL Command: MINUTE()

In the world of databases, MySQL is one of the most popular choices for managing and manipulating data. It offers a wide range of functions and commands that allow users to perform various operations efficiently. One such command is MINUTE(), which is used to extract the minute portion from a given time or timestamp value.

Syntax

The syntax for using the MINUTE() command is as follows:

MINUTE(time)

Here, time can be a valid time or timestamp value.

Example

Let’s consider an example to understand how the MINUTE() command works:

SELECT MINUTE('10:25:45');

The above query will return the minute portion from the given time value, which is 25.

Usage

The MINUTE() command can be useful in various scenarios. Here are a few examples:

1. Calculating Duration

Suppose you have a table that stores the start and end times of certain events. You can use the MINUTE() command to calculate the duration of each event by subtracting the minute portion of the start time from the minute portion of the end time.

SELECT MINUTE(end_time) - MINUTE(start_time) AS duration_minutes
FROM events;

This query will give you the duration of each event in minutes.

2. Filtering Data

You can also use the MINUTE() command to filter data based on specific time criteria. For example, if you want to retrieve all records where the minute portion of the timestamp is greater than 30, you can use the following query:

SELECT *
FROM records
WHERE MINUTE(timestamp) > 30;

This query will return all records where the minute portion of the timestamp is greater than 30.

3. Grouping Data

The MINUTE() command can be used in conjunction with the GROUP BY clause to group data based on the minute portion of a time or timestamp value. For example, if you want to calculate the average value for each minute of the day, you can use the following query:

SELECT MINUTE(timestamp) AS minute, AVG(value) AS average_value
FROM data
GROUP BY MINUTE(timestamp);

This query will give you the average value for each minute of the day.

Summary

The MINUTE() command in MySQL is a powerful tool for extracting the minute portion from a given time or timestamp value. It can be used for various purposes, such as calculating duration, filtering data, and grouping data. If you want to learn more about MySQL and its capabilities, consider exploring Server.HK, a leading VPS hosting company that offers reliable and efficient hosting solutions.

Recent Posts

  • VPS Hosting vs Shared Hosting: Why the Upgrade Is Worth It for Asia-Facing Websites
  • Hong Kong VPS vs Google Cloud Asia: Which Delivers Better China Performance in 2026?
  • Why No-ICP-Filing Hong Kong Hosting Is the Smart Choice for Cross-Border E-Commerce
  • Hong Kong VPS vs AWS Hong Kong Region: Cost, Latency, and Control Compared
  • Data Privacy Laws in Hong Kong: What VPS Users Need to Know

Recent Comments

  1. metoprolol generic on Hong Kong VPS vs Japan VPS: Head-to-Head for Asia-Pacific Deployments in 2026
  2. levitra price on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026
  3. finasterid on Hong Kong VPS vs Singapore VPS: Which Is Better for Your Asia Business in 2026?
  4. doxycycline hyclate 100mg on How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)
  5. ciprofloxacin 500 mg tablet on How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot