E
einsteinhelpme
Suppose I have a table with some fields containing the codes (integer
numbers) of some products (brands) and another table
containing the products together with their codes, just like this:
ID PRODUCT NAME
----------------------
1 Adidas
2 Nike
3 Reebok
----------------------
IDF FIELD_1 FIELD_2 FIELD_3
-----------------------------------------------
1 1 2 0
2 1 3 2
3 3 1 0
4 2 0 0
5 3 2 1
-----------------------------------------------
I'd need a query that shows the products in columns and the count of
each brand in each field in rows, i.e.:
PRODUCT NAME FIELD_1 FIELD_2 FIELD_3
-------------------------------------------------------
Adidas 2 1 1
Nike 1 2 1
Reebok 2 1 0
-------------------------------------------------------
How can I do this?
Best regards,
Sergio.
numbers) of some products (brands) and another table
containing the products together with their codes, just like this:
ID PRODUCT NAME
----------------------
1 Adidas
2 Nike
3 Reebok
----------------------
IDF FIELD_1 FIELD_2 FIELD_3
-----------------------------------------------
1 1 2 0
2 1 3 2
3 3 1 0
4 2 0 0
5 3 2 1
-----------------------------------------------
I'd need a query that shows the products in columns and the count of
each brand in each field in rows, i.e.:
PRODUCT NAME FIELD_1 FIELD_2 FIELD_3
-------------------------------------------------------
Adidas 2 1 1
Nike 1 2 1
Reebok 2 1 0
-------------------------------------------------------
How can I do this?
Best regards,
Sergio.