Cita:
Iniciado por GeriReshef Proba esto (con Over() despues del Max()):
Código SQL:
Ver originalSELECT top 25 orders.orderid AS id,customers.companyname AS cliente,employees.firstname AS vendedor,shippers.companyname
AS via_entrega,orders.orderdate AS fecha_compra,MAX (orders.freight AS valor_compra) OVER() FROM Orders INNER JOIN
customers ON orders.customerid = customers.customerid INNER JOIN employees ON orders.employeeid =
employees.employeeid INNER JOIN shippers ON orders.shipvia = shippers.shipperid;
No funciona ya lo habia intentado
Error: Mens. 195, Nivel 15, Estado 10, Línea 2
'MAX' is not a recognized built-in function name.
Pero cambie el orden de las cosas:
Código SQL:
Ver originalSELECT top 25 orders.orderid AS id,customers.companyname AS cliente,employees.firstname AS vendedor,shippers.companyname
AS via_entrega,orders.orderdate AS fecha_compra,MAX (orders.freight) OVER() AS maxima FROM Orders INNER JOIN
customers ON orders.customerid = customers.customerid INNER JOIN employees ON orders.employeeid =
employees.employeeid INNER JOIN shippers ON orders.shipvia = shippers.shipperid
Y ahi si da, la cosa es poner el alias hasta despues del over ()
Gracias !!!!