mysql - Get rows which do have references to list of values and at the same time don't have any references to list of other values -
I'm sure that was asked before but I did not know how to find it
I have Table Table 1:
| RefId_1 | RefId_2 | --------------------- | 1 | 133 | | 3 | 12 | | 4 | 144 | | 4 | 22 | | 3 | 123 | I need to get a list of RefId_1 , which is in the context of the list of RefId_2 , but any other list No reference RefId_2 of For example, I need a list of RefId_1 , which is the list of RefId_2 ( 133, 22, 44) but this should not be a reference to the list of RefId_1 RIFID_2 (12, 144, 111). Result only (1) Because (4) References to taboo 144
Thank you in advance
Renamed : ( Uensteaded ) Select DISTINCT REF_ID1 from Table 1 to WHERE REF_ID2 IN (133, 22, 44) and not REF_ID1 (Table 1 from selection REF_ID1 where REF_ID2 IN (12, 144, 111))
Comments
Post a Comment