28.06.2012, 12:57 | #21 |
Участник
|
Цитата:
Сообщение от GBH
А если так написать?
SELECT max(ch.modifiedon) AS 'Дата', ch.new_commentary AS 'Комментарий', opp.name AS 'ВС' FROM Filterednew_changeopportunity AS ch INNER JOIN FilteredOpportunity AS opp ON ch.regardingobjectid = opp.opportunityid WHERE (ch.actualend BETWEEN dbo.fn_BeginOfMonth(GETDATE()) AND GETDATE()) group by ch.new_commentary , opp.name SELECT max(ch.modifiedon) AS 'Дата',opp.name AS 'ВС' FROM Filterednew_changeopportunity AS ch INNER JOIN FilteredOpportunity AS opp ON ch.regardingobjectid = opp.opportunityid WHERE (ch.actualend BETWEEN dbo.fn_BeginOfMonth(GETDATE()) AND GETDATE()) group by opp.name То выдает как надо. Но стоит добавить ch.new_commentary он выдаёт всё. |
|
|
|