Attention all SQL gods! Query help needed.
Posted
by gurun8
on Stack Overflow
See other posts from Stack Overflow
or by gurun8
Published on 2010-06-10T21:21:55Z
Indexed on
2010/06/10
21:52 UTC
Read the original article
Hit count: 183
I need a little help putting together a SQL query that will give me the following resultsets:
and
The data model looks like this:
The tricky part for me is that the columns to the right of the "Product" in the resultset are really columns in the database but rather key/value pairs spanned across the data model.
Table data is as follows:
My apologies in advance for the image heavy question and the image quality. This just seemed like the easiest way to convey the information. It'll probably take someone less time to write the query statement to achieve the results.
By the way, the "product_option" table image is truncated but it illustrated the general idea of the data structure.
The MySQL server version is 5.1.45.
© Stack Overflow or respective owner