Quantcast
Channel: How to query with filter classifications - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to query with filter classifications

$
0
0

Looking for a way to filter clothes based on their labels, the labels need to be considered for their classifications, such that different classification all needs to be satisfied (AND), same classification is joined (OR).

E.g. The following expectation can be satisfied:

Ask: (Blue(classification: Color) or Green(classification: Color)) and On Sale(classification: Discount)

or

Ask: Blue(classification: Color) and (Aloha(classification: Style) or Knit(classification: Style))

Need help understand the best way to achieve this.

SELECT"clothes".*FROM"clothes"INNER JOIN "clothes_labels" ON"clothes_labels"."clothes_id" = "clothes"."id"INNER JOIN "labels" ON"labels"."id" = "clothes_labels"."tag_id"WHERE    ...

enter image description here


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images