Afficher un message
Vieux 18/09/2007, 05h03   #1
Mark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Retrieve ONLY first/max

So, I have a query

SELECT type
FROM order, product
WHERE order.id = product.id
GROUP BY type
ORDER BY sum(units) DESC

but I only want the first row. MS SQL 2005 doesn't seem to support
"LIMIT" or "FIRST" which is unfortunate. I can shove that whole query
into another one that checks the MAX, but then I can only get the MAX
number of units within a group, when I want to know the type that has
the max units in any group.

  Réponse avec citation
 
Page generated in 0,04220 seconds with 9 queries