EXTRACT()("提取"的意思) 函数用于返回日期/时间的单独部分,比如年、月、日、小时、分钟等等。
就是返回出来具体的年,月,日
2023-07-08 16:25:46.635
SELECT EXTRACT(YEAR FROM OrderDate) AS OrderYear,EXTRACT(MONTH FROM OrderDate) AS OrderMonth,EXTRACT(DAY FROM OrderDate) AS OrderDayEXTRACT(year_monthFROM OrderDate) AS ym FROM Orders
OrderYear OrderMonth OrderDay ym
2023 07 07 202307
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) | Powered by Discuz! X3.2 |