Hi All,
I cant product filtering. Please help.
CREATE TABLE filter (
product_no int(11) unsigned NOT NULL,
category_no int(11) unsigned NOT NULL,
PRIMARY KEY (product_no,cat egory_no)
);
INSERT INTO filter (product_no,cat egory_no)VALUES (1,68),(1,72),( 1,88),(1,97),(1 ,104),(1,117),( 1,124),(1,126), (1,130),(1,133) ,(2,68),(2,72), (2,88),(2,97),( 2,104),(2,117), (2,124),(2,127) ,(2,130),(2,133 ),(3,68),(3,73) ,(3,89),(3,97), (3,104),(3,117) ,(3,123),(3,126 ),(3,129),(3,13 3),(4,68),(4,72 ),(4,90),(4,95) ,(4,103),(4,117 ),(4,124),(4,12 7),(4,129),(4,1 33),(5,68),(5,7 3),(5,90),(5,95 ),(5,102),(5,11 7),(5,124),(5,1 27),(5,129),(5, 133),(6,68),(6, 73),(6,90),(6,9 5),(6,102),(6,1 17),(6,123),(6, 126),(6,129),(6 ,132);
select category_no,cou nt(product_no) from filter group by category_no;
For example
AMD 68 6
2ghz 117 6
2GB RAM 124 4
xyz ... .
abc ... .
i want filtering and count products (2ghz and AMD) ... (2BG and AMD)
or
(AMD and 2ghz and 2 BG) and (AMD and 2ghz and xyz)
AMD>2GHZ>200GB HD> .....
I cant product filtering. Please help.
CREATE TABLE filter (
product_no int(11) unsigned NOT NULL,
category_no int(11) unsigned NOT NULL,
PRIMARY KEY (product_no,cat egory_no)
);
INSERT INTO filter (product_no,cat egory_no)VALUES (1,68),(1,72),( 1,88),(1,97),(1 ,104),(1,117),( 1,124),(1,126), (1,130),(1,133) ,(2,68),(2,72), (2,88),(2,97),( 2,104),(2,117), (2,124),(2,127) ,(2,130),(2,133 ),(3,68),(3,73) ,(3,89),(3,97), (3,104),(3,117) ,(3,123),(3,126 ),(3,129),(3,13 3),(4,68),(4,72 ),(4,90),(4,95) ,(4,103),(4,117 ),(4,124),(4,12 7),(4,129),(4,1 33),(5,68),(5,7 3),(5,90),(5,95 ),(5,102),(5,11 7),(5,124),(5,1 27),(5,129),(5, 133),(6,68),(6, 73),(6,90),(6,9 5),(6,102),(6,1 17),(6,123),(6, 126),(6,129),(6 ,132);
select category_no,cou nt(product_no) from filter group by category_no;
Code:
------------------------------- category_no count(product_no) 68 6 72 3 73 3 88 2 89 1 90 3 95 3 97 3 102 2 103 1 104 3 117 6 123 2 124 4 126 3 127 3 129 4 130 2 132 1 133 5 -------------------------------
AMD 68 6
2ghz 117 6
2GB RAM 124 4
xyz ... .
abc ... .
i want filtering and count products (2ghz and AMD) ... (2BG and AMD)
or
(AMD and 2ghz and 2 BG) and (AMD and 2ghz and xyz)
AMD>2GHZ>200GB HD> .....
Comment