sql中的日期/时间 [英] date/time in sql

查看:56
本文介绍了sql中的日期/时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的选择语句:

This is my select statement:

展开 | 选择 | Wrap | 行号

推荐答案

嗨。


尝试 DATE_FORMAT 功能。


应该允许您将任何日期/时间类型字段转换为您想要的任何格式。
Hi.

Try the DATE_FORMAT function.

Should allow you to convert any date/time type field into whatever format you want.


我应该在create table中使用date_format,例如,


CREATE TEXT TABLE ALARMNOTIFICATION(

TIMESTAMP DATE_FORMAT(''HH:MM:SS''),
should I use the date_format in the create table for example,

CREATE TEXT TABLE ALARMNOTIFICATION(
TIMESTAMP DATE_FORMAT(''HH:MM:SS''),


不,它将在选择数据时使用。你看过链接由Atli提供?
No, it will be used at the time of SELECTing data. Did you look at the link provided by Atli?


这篇关于sql中的日期/时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆