Answer the question
In order to leave comments, you need to log in
Sql query to calculate sum of rows by 2 columns?
Greetings!
There is a table with 2 columns, 1 column Port 2 Subscriber
There are empty lines in the second column.
It is required by one SQL query to calculate the sum of rows in column 1 and the sum of rows in column 2, excluding empty rows.
Answer the question
In order to leave comments, you need to log in
select
count(port) ports_count,
count(case when abonent!='' then 1 else null end) abonents_count
from ports
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question