none
Erro Group BY RRS feed

  • Pergunta

  • Bom dia!

    Pq meu group by não funciona?

    SELECT        D.SchoolID, D.EntryID, D.FurnisherID, D.NoteNumber, D.Observation, D.Total, D.TotalDiscount, D.Discount, D.Checked, 
                             CASE WHEN D .Discount > 0 THEN D .TotalDiscounT ELSE D .Total END AS ValorFinal, P.ProductID, P.Name, 
                             CASE D .Checked WHEN 1 THEN 'Nota Aberta' ELSE 'Nota Fechada' END AS Status, E.Total AS TotalItem, E.PriceDiscount, E.Discount AS DiscontoItem, 
                             E.Price, E.Quantity, F.Name AS Fornecedor, S.Name AS Escola, D.DateEntry, D.DateEmition
    FROM            commons.EntryDetail AS E INNER JOIN
                             commons.Entry AS D ON E.SchoolID = D.SchoolID AND E.EntryID = D.EntryID INNER JOIN
                             commons.Product AS P ON E.SchoolID = P.SchoolID AND E.ProductID = P.ProductID INNER JOIN
                             commons.Furnisher AS F ON E.SchoolID = F.SchoolID INNER JOIN
                             commons.School AS S ON D.SchoolID = S.SchoolId AND P.SchoolID = S.SchoolId AND F.SchoolID = S.SchoolId
    WHERE        (D.SchoolID = 1201) AND (D.NoteNumber = '546')
    GROUP BY E.SchoolID, E.EntryID, D.FurnisherID, D.NoteNumber, D.Observation, E.Total, D.TotalDiscount, E.Discount, D.Checked, E.Discount, E.Total, E.ProductID, 
                             P.Name, D.Checked, E.Total, E.PriceDiscount, E.Discount, E.Price, E.Quantity, P.Name, D.DateEntry, D.DateEmition

    Erroo

    Bom, eu já tentei sem os apelido no Group e tb não deu certo...

    terça-feira, 10 de junho de 2014 12:23

Respostas

Todas as Respostas