Compare field with multiple values from another field [duplicate]

0

IwouldliketodoaSELECTbasedonmultiplevaluesofthe[jainscript]fieldandlisttheIDsthatarenotinthe[jainscript]field.

I'mtryingwithoutsuccess

$sql="SELECT * FROM usuarios WHERE email <> '$email' AND  id NOT LIKE jainscrito ";

In case if user id = 18 can only list id 20

    
asked by anonymous 01.04.2018 / 21:47

1 answer

1

From what I understand, you want to do something like this:

$sql = "select * from usuarios where email <> '$email' and ( select concat( '.', jainscrito, '.') from usuarios where email = '$email' ) not like concat( '%.', convert(id, char(5)), '.%') ";

Make sure it caters to you.

    
02.04.2018 / 21:21