我希望计算出来的一栏有几类数据,并能够加以索引。 这个问题与这一SO员额有关:。 Linq: 作为文本储存的日期
在此,我建立了数据库:
id INT
type INT
data computed column
下表中的一些抽样数据。
id---------type--------data
1----------1-----------190
2----------2-----------9/29/1972
3----------3-----------12.72
4----------1-----------2
5----------4-----------this is a test
As you can see the data
column has several data types. I wanted to know how do i implement a system like this and put an index the data
column as the datatype it should be. For example,
- Type is 1: Then the index will be INT
- Type is 2: Then the index will be DATE or DATETIME
- Type is 3: Then the index will be DECIMAL and so on
Is it possible to give the computed column an index on several different data types? If so, how might I do this? - then the index will be an inte