Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- select count(distinct EKOD) as 'Előfizetők száma'
- from ELOFIZ
- 2.
- create view ELOFIZETESEK as
- select ENEV, FCIM, EFIZDB
- from ETORZS T, FTORZS F, ELOFIZ E
- where T.EKOD = E.EKOD and F.FAZON = E.FAZON
- 3.
- create proc ELOFIZETO
- @EKOD smallint, @ENEV nchar(40), @ESZDAT date, @EIRSZ char(4), @ETELEP nvarchar(50), @EUTCA nvarchar(100), @visszater int
- output
- as
- if exists (select EKOD from ETORZS where EKOD=@EKOD)
- set @visszater=-1
- else
- begin
- insert into ETORZS values (@EKOD, @ENEV, @ESZDAT, @EIRSZ, @ETELEP, @EUTCA)
- set @visszater=0
- end
- declare @retval int
- execute ELOFIZETO 51,'David','1990.11.23','9024','Győr','Bartók u. 22.',@retval output
- if @retval<>0
- PRINT 'Ilyen előfizetőkód már létezik'
- else
- print 'A felvitel rendben megtörtént'
- 4.
- create function TELEPULES (@TELEP nvarchar(50)) returns table as
- return (select ENEV,EIRSZ +' '+ETELEP+' '+EUTCA' ' from ETORZS where ETELEP=@TELEP)
- select*
- from TELEPULES ('Győr')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement