Skip to content
Advertisement

How to get percentage between number of rows in two separate databases?


I have two databases (A and B). I need to find the percentage between number of **rows in A** and number of **rows in B** (for example, if I have *100 rows in A* and *10 in B*, *result will be 10%*).

Is there a way to do so using **JOIN** operator?

I tried with “**SELECT COUNT(*) FROM DBA**” to get the number of rows in A, but then I don’t know how to build the JOIN statement to get the percentage.

Thanks in advance.

Advertisement

Answer

You can use cross join:

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