sql - MySQL ORDER BY, GROUP BY within a JOIN -


I've have been looking for a while and have not found an example that works hope you know the obvious mistake can do!

  Timestamp, i_currency.Code Code conversion as i_convert choose from (Timestamp Conversion Order Select i_convert by DESC time mark) include i_convert.CurrencyID = i_currency i_currency By Ho Code   

I am not sure whether to be jointly added, should it be in parentheses, outside or both? I've tried all three with no luck, continue to:

  You have an error ... ... near (Select timestamp conversion orders from i_convert    

does not mean the original query. It uses the GROUP BY But the column is that neither the grouping column nor the total of the group works. Trying to select which time-mark and the conversion for any result line Are?

I think the objective is to select the most recent conversion for each currency. That will cause more visible thus:

  latest.Timestamp timestamp, as i_currency.Code code, i_convert.CurrencyID = i_currency.CurrencyID jOIN (max (timestamp join been selected i_currency as i_convert.Conversion conversion i_convert) as timestamp, CurrencyId Selection group by CurrencyId) i_convert.Timestamp = latest.Timestamp and i_convert.CurrencyId = Ml from latest.CurrencyId    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -