by Tatiana Lizarazo 9 years ago
325
More like this
SELECT * FROM tb_facturas WHERE coalesce (dto,0)= ANY (SELECT coalesce (dto,0) FROM facturas WHERE coalesce (IVA,0)0);
SELECT art_codigo, art_descripcion FROM tb_articulos WHERE art_precio >= all (SELECT a2_precio FROM articulosa2);
SELECT ven_codigo, ven_nombre FROM tb_vendedores WHERE ven_codigo not in (SELECT fac_codigo FROM tb_facturas);
SELECT pue_codigo, pue_nombre FROM tb_pueblos WHERE pue_codigo IN (SELECT pue_codigo FROM tb_clientes);
SELECT fact_codigo, fact_fecha FROM tb_facturas WHERE (dscto, IVA)= (SELECT MAX (dscto), MAX (IVA), FROM tb_facturas);
SELECT art_codigo, art_descripción FROM tb_articulos WHERE art_precio = (SELECT MAX art_precio FROM tb_articulos);
Cero, una o varias filas
Fila con una única columna
ANY
Expresion Operador ANY (Subconsulta)
ALL
Expresion operador ALL (Subconsulta)
EXIST
Expresion NOT INT (subconsulta) y (Expr 1, Expr 2,...) NOT IN (Subconsulta)
IN
Expresión In (subconsulta) y (expr 1, Expr 2,...) IN (Subconsulta)