Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Help

Author  Topic 

mszx
Starting Member

2 Posts

Posted - 2008-01-20 : 09:29:46
Nothing More

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-01-20 : 09:56:50
Make sure your pk of utilizador table is of IDENTITY type
ie.user_id number(10) not null IDENTITY(1,1)

INSERT INTO utilizador (user_nome,...)
VALUES('User1',...)

SELECT @UserID=SCOPE_IDENTITY()


SELECT f.film_nome,--list all film names rented/bought by user
CASE
WHEN a.alg_comp_def ='A' THEN 'Rent'
WHEN a.alg_comp_def ='C' THEN 'Bought'
END
FROM utilizador u
INNER JOIN aluguer_compra a
ON a.alg_comp_user_id= u.user_id
INNER JOIN filme f
ON f.film_id =a.alg_comp_film_id
WHERE u.user_id =@UserID
Go to Top of Page

mszx
Starting Member

2 Posts

Posted - 2008-01-20 : 10:49:31
Nothing More
Go to Top of Page
   

- Advertisement -