I need to query the SQL to find all the different values ββof one column, and I need an arbitrary value from two other columns. For example, consider the following table with three columns: CurrencyCode , BuyRate and SellRate :
CurrencyCode BuyRate SellRate AUD 1.037 1.97 AUD 1.079 1.99 EUR 0.7288 0.8763 EUR 0.731 0.88 GBP 0.59 0.72
I want to get one line with a great CurrencyCode , possibly getting these three lines:
CurrencyCode BuyRate SellRate AUD 1.037 1.97 EUR 0.7288 0.8763 GBP 0.59 0.72
I tried my SQL query, for example:
SELECT distinct CurrencyCode, BuyRate, SellRate FROM Currencies
But I do not get the desired result, since it rounds all the columns.
source share