>>The quiz said that choice C was correct. But it should be something like:
>>SELECT invoiceno, cnt(*) as InvCount from invoice into cursor MyCosts group by invoiceno
>
>Mark, I think your answer and the Quiz answer give identical results.
But... should the column in the result set be called TotCost? The question asked for (something like) the number of items per invoice... i.e., aggregating on InvoiceNo. TotCost would logically mean SUM(Cost), no? Why use Cnt(Cost)? One could just as easily use Cnt(InvoiceNo) or Cnt(*). I think that Cnt(*) is the least ambiguous way to indicate that you intend only to be counting instances at the given aggregation level.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement