2

これが私の簡略化された表です(SQL Server 2005):

table1: col1 int, col2 int, col3 cast(col1/col2 as int) [computed column]

何らかの理由で上記が機能しません。col1/col2 の全体を保存したいのですが、どうすればいいですか?

example: col1 = 5, col2 = 3 ... col3 should be 1
4

1 に答える 1

3

1 つのオプションは、フロア関数を使用することです。

FLOOR(列1/列2)

また

CONVERT(int, FLOOR(col1/col2)) -- やり過ぎかもしれません

于 2009-03-12T07:05:39.867 に答える