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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -