34,588
社区成员
发帖
与我相关
我的任务
分享
if exists(select * from sysobjects where [xtype]='p' and [name]='MyPro')
drop proc MyPro
go
create proc MyPro
as
@price int
select t.title as 书名, sum(s.qty) as 销售额度
From titles as t
inner join sales as s on s.title_id=t.title_id
group by t.title
where t.price > @price
select t.title as 书名, sum(s.qty) as 销售额度
From titles as t
inner join sales as s on s.title_id=t.title_id
where t.price > @price --不要放在group by后边,基础的语法!
group by t.title
--介绍是没错的,楼主要注意怎么写
create proc MyPro
@price int --要写在as前边!!!
as
select t.title as 书名, sum(s.qty) as 销售额度
From titles as t
inner join sales as s on s.title_id=t.title_id
group by t.title
where t.price > @price
create proc MyPro(@price int)
as
select t.title as 书名, sum(s.qty) as 销售额度
From titles as t
inner join sales as s on s.title_id=t.title_id
group by t.title
where t.price > @price