bonjour
j'essaie de faire une fonction qui retourne une table
mon requête:
mais avoir l'erreur suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 create function ex5(@NumC int) returns table as begin if exists(select CodeC# from Participation where CodeC#=@NumC ) begin return (select top 3 CodeJ,NomJ,PrenomJ from Joueur inner join Participation on Joueur.CodeJ=Participation.CodeJ# where @NumC=CodeC# order by Performance desc) end end
A RETURN statement with a return value cannot be used in this context.
Msg 102, Level 15, State 31, Procedure ex5, Line 10
Incorrect syntax near 'BEGIN'.
aidez moi SVP et merci
Partager