I have a database with a lot a currencies and each row has a currency, d开发者_运维问答atestamp and the exchange rate. What I would like to have is a query that gets me the latest exchange rate for all the currencies based on the datestamp. I would not like the date in the result.
Is this possible easily? I am using pervasive 10
I've never worked with pervasive but this will work with most DBs.
SELECT 
    c.currency
    c.exchange_rate 
FROM  
      currencies  c
       INNER JOIN 
        (SELECT 
            MAX(datestamp) datestamp , Currency
        FROM 
            currencies 
         GROUP BY 
            Currency) current_exchange
        ON c.datestamp  = current_exchange.datestamp  
       and
      c.Currency = current_exchange.Currency
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论