简体   繁体   English

SQL数据类型时间

[英]SQL data type time

Is it possible to create a data type in SQL similar to time that only displays the hour and minutes instead of the hour, minutes and seconds. 是否可以在SQL中创建类似于时间的数据类型,而该数据类型仅显示小时和分钟,而不是小时,分钟和秒。

For example, If I inserted values into a table with the data type time I would get hh:mm:ss. 例如,如果我将值插入数据类型为time的表中,则会得到hh:mm:ss。 How could I insert a value that only displays hh:mm? 如何插入仅显示hh:mm的值?

Use TIME . 使用TIME More generally, the format in which you want something displayed should not affect your decision of the format in which it should be stored. 更一般而言,您希望显示的内容格式不会影响您决定存储内容的格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM