|
查看: 1423|回复: 1
|
SQL server 2005 ascending view 的问题
[复制链接]
|
|
|
我create 了一个view, 用datatype datetime 来作为sorting (ascending). 在execute 的时候没有问题。可是save 了过后再开view 就有问题了。问题就是它不会是sort了的答案。大家不妨可以试试看用datetime 来做sorting. 请问大家有什么解决方案? |
|
|
|
|
|
|
|
|
|
|
发表于 27-10-2008 02:15 PM
|
显示全部楼层
回复 1# evo9 的帖子
可以把你的view definition 放来帖子吗?
假如用了convert function 然后又用和原本column相同的column alias 例如:
SELECT Employeeid, CONVERT(varchar, Birthdate, 101) AS Birthdate
FROM HumanResources.Employee
ORDER BY Birthdate
就会出问题,因为已经把Birthdate column换成varchar然后又把它命名为Birthdate, 这样sort 是根varchar 而不是跟 datetime 了。
 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|