Information générale
Catégorie:
Codage, syntaxe et commandes
I'm pleased that you found a solution to your problem but it doesn't make sense to me.
Even though the GROUP BY clause is usually used with an aggregation function (in this case MAX(date)), in my experience the following two SELECTs return the same result set.
SELECT fld1 from sometabl group by 1
SELECT fld1 distinct from sometabl
and if applied to your data set would return both items (with and without the R)
>I have found the answer thanks to all of you. I needed to use the group by but not order by as long as I used the max(date). This gave me all the records and the latest prices.
>
>Thanks!
>
>>>>If you remove the GROUP BY, does the missing item show up?
>>>
>>>Yes, The item does show up (seven times).
>>
>>Then it must be the GROUP BY that's the culprit...
>>
>>Did you say somewhere else that "Select Distinct Item..." instead of GROUP BY didn't work also, or have you tried that?
Précédent
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