Webnaranja  
help consulta
Bases de Datos Bases de Datos: MySQL, SQL, Oracle
Reply to topic   Printer Friendly Page    Forum Index - Proyectos Web - Bases de Datos
View previous topic :: View next topic  
Author Message
el_man_bbdd
Nuevo
Nuevo


Joined: Apr 05, 2017
Posts: 1

PostPosted: Wed Apr 05, 2017 3:42 am    Post subject: help consulta Reply with quote

Saludos Comunidad

Tengo las sgts. tablas cab_compras , det_compras, com_proveedores, productos
la consulta me debe arrojar los sgt.

la ultima compra (fecha mas actual)

productos
id nombre
1 prod1
2 prod2
3 prod3
4 prod4

com_proveedores
id nombre
1 xxx
2 yyy
3 zzz

cab_compras
id idprovee fecha subtotal1 descto sutotal2 impuesto total
1 1 02-01-2017 #### ### ### ## ####
2 2 02-02-2017 #### ### ### ## ####
3 3 02-03-2017 #### ### ### ## ####
4 1 15-03-2017 #### ### ### ## ####
5 2 28-03-2017 #### ### ### ## ####

det_compras
id_compras id_item cant costo total
1 1 50 ## ##
1 2 60 ## ##
1 4 70 ## ##

2 1 50 ## ##
2 3 75 ## ##

3 3 80 ## ##

4 1 50 ## ##
4 2 50 ## ##
4 4 50 ## ##

5 4 80 ## ##


RESULTADO (ultima compra x item)
______________
item prove cant fecha
prod1 xxx 50 15-03-2017
prod2 xxx 50 15-03-2017
prod3 zzz 80 02-03-2017
prod4 yyy 80 28-03-2017

Gracias


Back to top
View user's profile
Display posts from previous:   
 Reply to topic   Printer Friendly Page     Forum Index - Proyectos Web - Bases de Datos All times are GMT + 1 Hour
Page 1 of 1




RSS: Bases de Datos RSS
Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Diseño web, bases de datos, lenguajes de programación, comunidades... todo lo necesario para construir tu sitio web.
The logos and trademarks used on this site are the property of their respective owners. We are not responsible for comments posted by our users, as they are the property of the poster.
Aviso Legal - Privacidad
Construyendo la web 2.0
Interactive software released under GNU GPL, Code Credits, Privacy Policy

Orange Theme by WebNaranja.com more Info.