Database: MySQL 5.0.45
need help with an "inline view" of the product attributes on a regular mysql query.
The issue with the following query is that it will only return the first product attribute. We have more than one product attribute and would like to see them returned in the row (out to the right).
Example...
we want to just run a back end query with the following information and the attributes in the actual row for the orders. size, color and image are all in zen_orders_products_attributes.products_options_values and our query only allows for one of those to be returned.... there has to be a way to subquery this to get it all in the one line.
qty | orderdate | orderno | customer | email | model | product | price | finalprice | *** need this.... size | color | image | ***
qty | orderdate | orderno | customer | email | model | product | price | finalprice | *** need this.... size | color | image | ***
qty | orderdate | orderno | customer | email | model | product | price | finalprice | *** need this.... size | color | image | ***
Please help.
******* query **********
SELECT
zen_orders_products.products_quantity as qty,
zen_orders.date_purchased as orderdate,
zen_orders.orders_id as orderno,
zen_orders.customers_name as customer,
zen_customers.customers_email_address as email,
zen_orders_products.products_model as model,
zen_orders_products.products_name as product,
zen_orders_products.products_price as price,
zen_orders_products.final_price as final,
zen_orders_products_attributes.products_options as opt,
zen_orders_products_attributes.products_options_values as value
FROM
zen_orders
inner join zen_orders_products on zen_orders_products.orders_id=zen_orders.orders_id
inner join zen_orders_total on zen_orders_total.orders_id=zen_orders_products.orders_id
inner join zen_orders_products_attributes on zen_orders_products_attributes.orders_products_id=zen_orders_products.orders_pro ducts_id
inner join zen_customers on zen_orders.customers_id=zen_customers.customers_id
where (zen_orders_products.products_model like '%model%' and zen_orders_products_attributes.products_options_values like '%size%' and zen_orders.orders_status>2)
group by zen_orders.orders_id
order by zen_orders.customers_name




