Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --1
- create function zero_shop_book()
- returns int
- as
- begin
- declare @c int
- select @c=count(shops.ID_SHOP)
- from sale.Sales sales, sale.Shops shops
- where sales.ID_SHOP=shops.ID_SHOP
- group by shops.ID_SHOP
- having count(sales.ID_SALE)=0
- return @c
- end
- go
- --2
- create function min_val(@a int, @b int, @c int)
- returns int
- as
- begin
- return
- case when @a < @b and @a < @c then
- @a
- else case when @b <@c then
- @b
- else
- @c
- end
- end
- end
- go
- --3
- create function count_sales_book()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement