Hola amigos,
Tengo estos 2 select se que con un union podria unirlos pero en este caso no ya que me retorna datos distintos uno del otro, pero necesito unirlos de alguna manera, alguna ayuda?
consulta 1:
Código SQL:
Ver originalSELECT CONVERT(VARCHAR(8), G.[GradedDate] , 108) AS 'Time',
CONVERT(VARCHAR(MAX),G.[VisitorNumber]) + '/' + CONVERT(VARCHAR(MAX),G.[HomeNumber]) AS 'NumGame', G.[VisitorTeam] + ' @ ' +G.[HomeTeam] AS 'Teams', P.[PeriodDescription],
CONVERT(VARCHAR(MAX),G.[VisitorScore]) + ' - ' + CONVERT(VARCHAR(MAX),G.[HomeScore]) AS 'Score', COUNT(*) AS 'Tickets',
SUM(H.[RiskAmount]) AS 'Risk', A.[Agent], D.[RESULT], SUM(H.[WinAmount]) AS 'Win', D.[IdGame]
FROM GRADEDWAGERHEADER H, GRADEDWAGERDETAIL D, GRADEDGAME G, PERIOD P, AGENT A, WAGERTYPE W
WHERE H.[IdWager] = D.[IdWager] AND
D.[IdGame] = G.[IdGame] AND
H.[IdAgent] = A.[IdAgent] AND
H.[IdWagerType] = W.[IdWagerType] AND
H.[SettledDate] >= CONVERT(datetime,('2014-01-12 00:00:01')) AND
H.[SettledDate] <= CONVERT(datetime,('2014-01-12 23:59:59')) AND
D.[IdSport] = P.[IdSport] AND
D.[Period] = P.[NumberOfPeriod] AND
W.[Description] LIKE '%STRAIGHT%' AND
H.[IdAgent] = 5585
GROUP BY G.[GradedDate], G.[VisitorNumber], G.[HomeNumber], G.[VisitorTeam], G.[HomeNumber], G.[HomeTeam],
P.[PeriodDescription], G.[VisitorScore], G.[HomeScore], A.[Agent],D.[RESULT], D.[IdGame]
consulta 2:
Código SQL:
Ver originalSELECT CONVERT(VARCHAR(8), G.[GradedDate] , 108) AS 'Time',
CONVERT(VARCHAR(MAX),G.[VisitorNumber]) + '/' + CONVERT(VARCHAR(MAX),G.[HomeNumber]) AS 'NumGame', G.[VisitorTeam] + ' @ ' +G.[HomeTeam] AS 'Teams', P.[PeriodDescription],
CONVERT(VARCHAR(MAX),G.[VisitorScore]) + ' - ' + CONVERT(VARCHAR(MAX),G.[HomeScore]) AS 'Score', COUNT(*) AS 'Tickets',
SUM(H.[RiskAmount]) AS 'Risk', A.[Agent], D.[RESULT], SUM(H.[WinAmount]) AS 'Win', D.[IdGame], D.[IdWager]
FROM GRADEDWAGERHEADER H, GRADEDWAGERDETAIL D, GRADEDGAME G, PERIOD P, AGENT A, WAGERTYPE W
WHERE H.[IdWager] = D.[IdWager] AND
D.[IdGame] = G.[IdGame] AND
H.[IdAgent] = A.[IdAgent] AND
H.[IdWagerType] = W.[IdWagerType] AND
H.[SettledDate] >= CONVERT(datetime,('2014-01-12 00:00:01')) AND
H.[SettledDate] <= CONVERT(datetime,('2014-01-12 23:59:59')) AND
D.[IdSport] = P.[IdSport] AND
D.[Period] = P.[NumberOfPeriod] AND
W.[Description] LIKE '%PARLAY%' AND
H.[IdAgent] = 5585
GROUP BY G.[GradedDate], G.[VisitorNumber], G.[HomeNumber], G.[VisitorTeam], G.[HomeNumber], G.[HomeTeam],
P.[PeriodDescription], G.[VisitorScore], G.[HomeScore], A.[Agent],D.[RESULT], D.[IdGame], D.[IdWager]