I've a table on mysql:
code1 tinyint, code2 tinyint, notcode1 varchar(20),not code2
varchar(20),lab el
I do have some records:
values(1,null,n ull,null,'text1 ');
values(2,null,n ull,'17,18','te xt2');
values(2,null,n ull,'15','text3 ');
look at the second record
in my case if code1 = 2 and (code2 <> 17 and code2 <> 18) it should return
'text2'.
But how to create a query since I've values for code1 and code2 ?
where $valcode1 = code1 and ($valcode2 not in notcode2) ?
but how to do not in notcode2 in mysql ?
I've full control on the table, so I may put any kind of field type (didnt'
find any array type in mysql and since enum and set are predefined values,
they seems not fit my need since the values are different from case to case.
but I may be wrong since I don't know how to use enum and set fields)
Of course, if the values are 2 and 17, text3 must be in the query result !
Bob
PS: I've no access to mysql NG with my ISP, so please don't tell me not to
ask in this NG.
code1 tinyint, code2 tinyint, notcode1 varchar(20),not code2
varchar(20),lab el
I do have some records:
values(1,null,n ull,null,'text1 ');
values(2,null,n ull,'17,18','te xt2');
values(2,null,n ull,'15','text3 ');
look at the second record
in my case if code1 = 2 and (code2 <> 17 and code2 <> 18) it should return
'text2'.
But how to create a query since I've values for code1 and code2 ?
where $valcode1 = code1 and ($valcode2 not in notcode2) ?
but how to do not in notcode2 in mysql ?
I've full control on the table, so I may put any kind of field type (didnt'
find any array type in mysql and since enum and set are predefined values,
they seems not fit my need since the values are different from case to case.
but I may be wrong since I don't know how to use enum and set fields)
Of course, if the values are 2 and 17, text3 must be in the query result !
Bob
PS: I've no access to mysql NG with my ISP, so please don't tell me not to
ask in this NG.
Comment