sql - Select rows as column -


 name  | value  | product_id  -------+--------+------------  color | red    |          9  style | modern |          9  brand | xxx    |          1  color | blue   |          4  color | red    |          1 

how select product ids, brand = xxx , color = red? product id=1.

select product_id tbl "name"='color' , "value"='red' intersect select product_id tbl "name"='brand' , "value"='xxx'; 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -