sql - How to calculate Sum of 2 Count(*) in Mysql -
i have 2 tables count rows of them.
select count(*) docgrados_directores docgrados_directoresleido = '0' , docgrados_directoresusu = '11' result 1 select count(*) docgrados_lectores docgrados_lectoresleido = '0' , docgrados_lectoresusu = '11' result 1
i need total count (result 2). how can sum result single statement? correct syntax??
use select
add scalar values returned queries:
select (select count(*) docgrados_directores docgrados_directoresleido = '0' , docgrados_directoresusu = '11' ) + (select count(*) docgrados_lectores docgrados_lectoresleido = '0' , docgrados_lectoresusu = '11')
the above statement should return 2
result if result of both subqueries 1
.
Comments
Post a Comment