我有三个参数@code
是table1.column1
任何元件,@date
是元件table2.column2
的日期和@total
将是示出了出现在元件table2.column2
时代的输出参数。执行输出参数SQL服务器
我想执行一个程序,显示table1.column1
和table2.column1
与date_column
之间的内部连接;只有在参数@date
之前的日期。
而且还@total
create procedure pro1
@code int,
@date datetime,
@total smallint OUTPUT
as
select
table1.column1, table2.date_column
from
table1
inner join
table2 on table1.column1 = table2.column2
where
table1.column1 = @code
and table2.date_column = @date
and @date <= table2.date_column
您说“行数之和” - 你能澄清吗?你的意思是“(某些列的总和)”或“行数”? – 2014-09-21 15:17:30