Interval datatype in MySql

前端 未结 2 1140
忘掉有多难
忘掉有多难 2021-01-12 23:06

Does MySql has the Interval datatype as PostgreSQL (or like TimeSpan in .net) does?

2条回答
  •  星月不相逢
    2021-01-12 23:26

    No. There are interval functions, but not datatypes.

    If the intervals you're concerned with are less than 838 hours, you might be able to use the TIME type to get the behavior you want.

    From the manual:

    MySQL interprets TIME values as elapsed time rather than as time of day.
    

提交回复
热议问题