mercredi 9 décembre 2015

sql relational divide selecting all entries with a column that have all values in a list.

I have a table like this:

fields1 | field2

1_______| a_____

1_______| b_____

1_______| c_____

2_______| a_____

2_______| c_____

and a list of field2 [a,b,c].

I need preferable 1 SQL query that select all field1 entries with the follow conditions:

-the list include all fields2 ex: 1 (a,b,c)

OR

-all fields2 are included in the list ex: 2 (a,c)

Aucun commentaire:

Enregistrer un commentaire