Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用过这个
select datename(weekday,getdate())
给我今天的日期,但如果我使用
SELECT DATENAME(weekday,dob()) from myTable
其中 dob 是我想要获取日期或星期的存储字段,它给了我一个错误。有没有办法轻松做到这一点?
你的专栏里有括号吗?我猜它不是,所以你只使用列名:
SELECT DATENAME(weekday,dob) from myTable
查看带有示例的sql fiddle