| 列名 | 列类型 | 列约束 | 表约束 |
|---|---|---|---|
| row_num | SMALLINT | NOT NULL |
dbo.RowGenerator 表是以只读表的形式提供的,具有 255 行。此表用于生成的结果集较小的查询以及需要某一范围的数值的查询。
RowGenerator 表由系统存储过程和视图所使用,不应以任何方式对其进行修改。
您还可以使用 sa_rowgenerator 存储过程生成一定范围内的数字值。
有关详细信息,请参见 sa_rowgenerator 系统过程。
row_num 介于 1 和 255 之间的值。
以下查询返回的结果集包含当前月的每一天的一行记录。
select dateadd(day,row_num-1,
ymd(datepart(year,current date),
datepart(month,current date),
1)) as day_of_month
from dbo.RowGenerator
where row_num < 32
and datepart(month,day_of_month) =
datepart(month,current date)
order by row_numSQL Anywhere Studio 9.0.2
版权所有 © 1989–2005 Sybase, Inc. 部分版权所有 © 2001–2005 iAnywhere Solutions, Inc. 保留所有权利。