• xtrmus2319 - Wednesday, January 24, 2018 3:15 PM

    My question;
    Create a new column. In this column I would like to show the ratio of A.Price / B.Price when 3 minutes before(a.price) and current data(B.price) with same coin. 

    ADA/BTC A.price/B.price
    ADX/BTC A.price/B.price
    ...
    ...
    ...
    ZRT/BTC A.price/B.price

    Thanks.Is it understandable?

    Yes but what you're trying really just isn't the way SQL works.

    A)  As has been said you've created a cartesian join which means that every row in each result set will be joined together., that's why your result set has 10000 rows and many values where the coins don't match.
    B) To generate the result sets you expect/describe would require some very specific assumptions and will be either missing data or just wrong if those assumptions aren't true
    C) You're assuming data will come in exact chunks of 100 and have exactly 1 batch per minute to generate you're expected resulting offset of 100 rows current vs. 3 minutes ago and the coins in each batch will always be the same
    D) Even if the above is true the query could only be run while no data is being added

    What is the purpose of this query?  Do you need to compare the value of a coin vs the same coin from exactly three minutes ago?  Do you get coins that don't meet any of the assumptions above?