1
The select I’m making is this:
SELECT DISTINCT dbo.Entity.ComercialName
,dbo.ScheduleStatus.Description
,dbo.ScheduleGoal.Description AS alias_DSG
,dbo.ScheduleType.Description AS alias_DST
,dbo.Entity.ID
,dbo.Schedule.Notes
,dbo.Schedule.DATE
FROM (
dbo.Schedule RIGHT JOIN dbo.ScheduleStatus ON ScheduleStatus.id = Schedule.ScheduleStatus
)
RIGHT JOIN dbo.ScheduleGoal ON Schedule.ScheduleGoal = ScheduleGoal.Id
RIGHT JOIN dbo.ScheduleType ON Schedule.ScheduleType = ScheduleType.id
RIGHT JOIN dbo.Entity ON SChedule.Entity = Entity.Id
GROUP BY Entity.ComercialName
,ScheduleStatus.Description
,ScheduleGoal.Description
,ScheduleType.Description
,Entity.ID
,Schedule.Notes
,Schedule.DATE;
The result I desire is:
It seems that this result is acquired at the time of encoding the appearance of the report, and not directly in the table of the resulting database. In the case of scheduling the report design events in the application source code.
– Please_Dont_Bully_Me_SO_Lords
But you could do this with a recursive SQL code using UNION ALL of a result with the first columns, and a result of the other results after the first, of each row of the first result. It would have to be dynamic SQL.
– Please_Dont_Bully_Me_SO_Lords
and how do I do it? when doing UNION ALL it will join the repeated fields?
– Nuno Ferreira