Nesting af select-sætninger
Jeg ønsker at neste op til 3 niveauer af select-sætninger som vist nedenfor:***************************************************
select
( select 'AGF' as hold, count(matchday) as 'kampe',
/*TOTAL PONT FOR AGF*/
( select sum(home_team_points)from matches
where home_team='AGF')+
( select sum(away_team_points )
from matches
where away_team='AGF') as 'point'
from matches
where (home_team='AGF' or away_team='AGF')),
( select 'BIF' as hold, count(matchday) as 'kampe',
/*TOTAL PONT FOR BIF*/
( select sum(home_team_points)from matches
where home_team='BIF')+
( select sum(away_team_points)from matches
where away_team='BIF') as 'point'
from matches
where (home_team='BIF' or away_team='BIF'))
from matches
******************************************************
Imidlertid lader det sig ikke umiddelbart gøre-jeg får følgende fejlmeddelelse:
Server: Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not
introduced with EXISTS.
Server: Msg 116, Level 16, State 1, Line 1
Only one expression can be specified in the select list when the subquery is not
introduced with EXISTS.
