Is it possible to select a specific ORDER BY in SQL Server 2008?

后端 未结 2 1135
南旧
南旧 2020-12-31 07:34

I have a table that holds days and times, the day column, can have any of the seven days entered into it, and they are set to data type varchar. As this table h

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 08:08

    IMHO you don't have any reason to store Monday, Tuesday, etc ... If you store the date or datetime value, you can always extract the weekday name from that data at query time when you need it - either using DATENAME in your query or using the functionality in your presentation tier. The performance cost of doing so doesn't justify storing it separately IMHO. And you should still be able to sort correctly using the native date/datetime data.

提交回复
热议问题