2
good afternoon!
I have a table like this:
id | valor | nome_campo | item_id (fk) ---------------------------------------------- 1 | 9 | campo_1 | 22 2 | 10 | campo_2 | 21 3 | 2 | campo_2 | 22 4 | 3 | campo_2 | 21 5 | 3 | campo_1 | 22 6 | 9 | campo_2 | 26 7 | 9 | campo_1 | 22 8 | 9 | campo_3 | 25 9 | 10 | campo_4 | 27 10 | 9 | campo_1 | 24 11 | 10 | campo_2 | 22 12 | 10 | campo_2 | 24 13 | 10 | campo_2 | 22 14 | 10 | campo_1 | 21
I need to list all the records where:
field_name = 'field_1' and value = 9
AND / OR ????
field_name = 'field_2' and value = 10
but that the item_id column is in common to the records returned based on the lines above.
The expected result is this:
id | valor | nome_campo | item_id (fk) ---------------------------------------------- 1 | 9 | campo_1 | 22 7 | 9 | campo_1 | 22 11 | 10 | campo_2 | 22 13 | 10 | campo_2 | 22 12 | 10 | campo_2 | 24 10 | 9 | campo_1 | 24
The values that are passed to the "mount" of the query’s Where are "field_1, value 9 and field_2, value 10"
Thank you.
I answered the question because I didn’t have room
– Quati_Maldito