locked
Alias RRS feed

  • Pergunta

  • Viva!

    Estou com dificuldade em interpretar como utilizar Alias numa consulta.

    Por exemplo:

    SELECT T_Names.Name, T_Names.IdName, T_Ends.IdEnd, T_Ends.IdName, Count(T_Ends.IdName) AS CountOfOrders, (SELECT Count(*)

    FROM T_Names AS [XX] WHERE [XX].IdName = T_Names.IdName AND [XX].IdEnd <= T_Ends.IdEnd) AS Person_Count
    FROM T_Names LEFT JOIN T_Ends ON T_Names.[IdName] = T_Ends.[IdName]
    WHERE (((T_Names.Name) ALike "A"))
    GROUP BY T_Names.Name, T_Names.IdName, T_Ends.IdEnd, T_Ends.IdName, (SELECT Count(*) FROM T_Names AS
    [XX] WHERE [XX].IdName = T_Names.IdName AND [XX].IdEnd <= T_Ends.IdEnd);

     

    Obrigado.

    an

     

    sexta-feira, 24 de setembro de 2010 11:08