Kan man seletera en WHERE sats i UNION ALL? SQL Server 2005 Du kan ha en WHERE till varje SELECT, men inte en övergripande över hela din UNION.UNION ALL?
SELECT MatchId, LagIdHemma AS TeamId, Resultathemma AS PointsFor, ResultatBorta AS PointsAgainst
FROM Match
UNION ALL
SELECT MatchId, LagIdBorta AS TeamId, ResultatBorta AS PointsAway, Resultathemma AS PointsHome
FROM Match AS Match_1) AS view1 INNER JOIN
Team ON view1.TeamId = Team.TeamId
WHERE Match.LagIdHemma = Match.LagIdBorta
Och isf var skall man skriva in det?
Sv: UNION ALL?
/johan/