How can I do a select count for 3 tables with the same ID?

0

My first table is called tipoPension - cod_tipopension , second reporte - cod_tipopension and third dictamen - cod_tipopension

    
asked by paolo palomino 03.08.2018 в 17:08
source

2 answers

0

You can join the 3 queries in a single result

(SELECT COUNT( cod_tipopension ) as 'Tipo pensión' FROM tipoPension)
UNION
(SELECT COUNT( cod_tipopension ) as 'Reporte' FROM reporte )
UNION
(SELECT COUNT( cod_tipopension ) as 'Dictamen' FROM dictamen )
    
answered by 03.08.2018 / 17:19
source
0

Hello there are different ways with a simple INNER or another way

Select  count(*) from(

consulta1

UNION ALL

consulta2

UNION ALL

consulta3 ) DATOS

I hope it's your help, Greetings !!

    
answered by 03.08.2018 в 17:25