Created
July 29, 2018 21:06
-
-
Save dario61081/779ad07f865b24c6fe29b05002d90821 to your computer and use it in GitHub Desktop.
Seleccionando items de una tabla contra una lista subselect. (firebird)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- seleccionando items de una tabla contra una lista subselect (firebird). | |
select p.categoria, t.sub_categoria,0 monto | |
from pagos p, (select distinct pp.sub_categoria from pagos pp) t | |
group by 1,2 | |
-- dataset -- | |
-- categoria: 7,8,9 | |
-- sub categoria: a,b,c,d,e | |
-- results -- | |
CATEGORIA SUB_CATEGORIA MONTO | |
7 a 0 | |
7 b 0 | |
7 c 0 | |
7 d 0 | |
7 e 0 | |
8 a 0 | |
8 b 0 | |
8 c 0 | |
8 d 0 | |
8 e 0 | |
9 a 0 | |
9 b 0 | |
9 c 0 | |
9 d 0 | |
9 e 0 | |
-- origen -- | |
select distinct p.categoria, p.sub_categoria,0 monto | |
from pagos p | |
group by 1,2 | |
-- results -- | |
CATEGORIA SUB_CATEGORIA MONTO | |
7 a 0 | |
8 b 0 | |
8 c 0 | |
9 a 0 | |
9 d 0 | |
9 e 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment