Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/06/2009, 15:56
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: Por favor necesito ayuda

Primera consulta:

Código mysql:
Ver original
  1. select c.marca,sum(cantidad*precio_venta) from ventas v inner join cigarrillos c
  2. on v.cod_cigarrillo=c.cod_cigarrillo where v.fecha = '1995-08-22' group by c.marca;
Segunda consulta:

Código mysql:
Ver original
  1. select e.nif,e.nombre from estancos e inner join almacenes a
  2. on e.nif = a.nif
  3. inner join cigarrillos c on c.cod_cigarrillo = a.cod_cigarrillo
  4. where c.marca = 'Winston' and c.marca <> 'celtas';

Pruebalas y nos cuentas.

un saludo.
__________________
Without data, You are another person with an opinion.
W. Edwads Deming