Unir 2 consultas
Publicado por AzureSky (1 intervención) el 13/11/2008 13:58:46
Les comento tengo 2 consultas hechas las cuales sonlas siguientes:
1.
select sro3kr, sro2kr as producto
from relacionesconsulta
where sro1kr = 21823
and sro2kr in (select llkr
from movimientosdeproductos
where fecemision_n >= '20081001'
and fecemision_n <= '20081002'
and llkr < 2000
group by llkr)
and srvalor <> '*'
order by sro2kr
2.
select llkr, sum(centavos) as importe
from movimientosdeproductos
where fecemision_n >= '20081001'
and fecemision_n <= '20081002'
group by llkr
Quisiera saber como hacer para poder unir estas dos consultas y que me queden las columnas sro3kr, sro2kr e importe.
Quise hacerlo con inner join pero no se como. Si alguien fuera tan amable de ayudarme se los agradeceria mucho.
Saludos
1.
select sro3kr, sro2kr as producto
from relacionesconsulta
where sro1kr = 21823
and sro2kr in (select llkr
from movimientosdeproductos
where fecemision_n >= '20081001'
and fecemision_n <= '20081002'
and llkr < 2000
group by llkr)
and srvalor <> '*'
order by sro2kr
2.
select llkr, sum(centavos) as importe
from movimientosdeproductos
where fecemision_n >= '20081001'
and fecemision_n <= '20081002'
group by llkr
Quisiera saber como hacer para poder unir estas dos consultas y que me queden las columnas sro3kr, sro2kr e importe.
Quise hacerlo con inner join pero no se como. Si alguien fuera tan amable de ayudarme se los agradeceria mucho.
Saludos
Valora esta pregunta


0