SQL将时间 2023/5/10 0:00:00输出为日期
时间: 2024-05-08 13:21:13 浏览: 49
![PDF](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PDF.png)
变量类型-雷达系统 第4版 [张明友,汪学刚 编著] 2013年版
在 SQL 中,可以使用 CAST 函数将时间转换为日期。假设你的时间是存储在一个名为 `time_col` 的列中,你可以使用以下 SQL 语句将其转换为日期:
```
SELECT CAST(time_col AS date)
FROM your_table;
```
对于给定的时间 `2023/5/10 0:00:00`,你可以将其替换为相应的列名或值。这将返回一个日期,格式为 `YYYY-MM-DD`。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)