Skip to content
Advertisement

Dividing two SQL queries

I am not super familiar with SQL queries, but I am trying to divide the results of two queries, ex. # of users with at least $x / total # of users, and I keep running into an error. Here is the code:

I tried to do it without the y as well, and it gave me an error still. Here is the entire code above the statement I am having trouble with:

I know the code from the first line up until the SELECT x.number / y.number is correct because I previously used it to count the # of people with $>0 in their crypto wallet. Now I want to modify it to divide that value by the total # of wallets.

Advertisement

Answer

you use aliases that where not defined

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement