889001_1508423063 Posted November 12, 2018 Share Posted November 12, 2018 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 More sharing options...
joseantgv Posted November 12, 2018 Share Posted November 12, 2018 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 More sharing options...
889001_1508423063 Posted November 13, 2018 Author Share Posted November 13, 2018 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 More sharing options...
Italo Morales Posted January 9, 2019 Share Posted January 9, 2019 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now