Jump to content

Consulta SQL productos


889001_1508423063

Recommended Posts

Muy buenas tardes, quería pedir ayuda con una consulta SQL que estoy generando para tener un listado de productos vendidos.

SELECT id_order, product_name,product_reference, product_supplier_reference, product_upc, product_quantity FROM ps_order_detail

tengo que agregarle una columna con el estado de la pedido y otra columna con la fecha del pedido. He intentado hacerlo sin resultado.

 

muchas gracias

 

 

Link to comment
Share on other sites

Prueba esta query:

 

SELECT od.id_order, product_name,product_reference, product_supplier_reference, product_upc, product_quantity, osd.name, o.date_add
FROM ps_order_detail od
LEFT JOIN ps_orders o ON (od.id_order = o.id_order)
LEFT JOIN ps_order_state_lang osd ON (o.current_state = osd.id_order_state AND osd.id_lang = 1)

 

Link to comment
Share on other sites

On 12/11/2018 at 4:37 AM, joseantgv said:

Prueba esta query:

 


SELECT od.id_order, product_name,product_reference, product_supplier_reference, product_upc, product_quantity, osd.name, o.date_add
FROM ps_order_detail od
LEFT JOIN ps_orders o ON (od.id_order = o.id_order)
LEFT JOIN ps_order_state_lang osd ON (o.current_state = osd.id_order_state AND osd.id_lang = 1)

 

 

On 12/11/2018 at 4:37 AM, joseantgv said:

Prueba esta query:

 


SELECT od.id_order, product_name,product_reference, product_supplier_reference, product_upc, product_quantity, osd.name, o.date_add
FROM ps_order_detail od
LEFT JOIN ps_orders o ON (od.id_order = o.id_order)
LEFT JOIN ps_order_state_lang osd ON (o.current_state = osd.id_order_state AND osd.id_lang = 1)

 

muchas gracias, es justo lo que necesitaba.

 

saludos

 

Link to comment
Share on other sites

  • 1 month later...
En 12/11/2018 a las 4:37 AM, joseantgv dijo:

Prueba esta query:

 


SELECT od.id_order, product_name,product_reference, product_supplier_reference, product_upc, product_quantity, osd.name, o.date_add
FROM ps_order_detail od
LEFT JOIN ps_orders o ON (od.id_order = o.id_order)
LEFT JOIN ps_order_state_lang osd ON (o.current_state = osd.id_order_state AND osd.id_lang = 1)

 

Amigo...yo necesito hacer la misma query cuando se listan los productos en STOCK

 

blob.thumb.png.0dfc6685b931f608ff077df385ba0671.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...