On 4/26/06, Patrick Aljord <[EMAIL PROTECTED]> wrote:
> I have a table confs like this:
> id int 5 auto_increment primary key;
> conf text;
>
> and another table conf_ip like this:
> id int 5 auto_increment primary key;
> conf_id int 5; ==>foreing key of confs
> ip varchar 150;
>
ok, sorry all for not being specific enough. I figured a query which
is half working like that:
"select c.id, c.conf from confs as c inner join conf_ip as i on c.id =
i.conf_id where i.ip!='someip"
I would like the select to return all the c.id that are in conf and
all that don't have a c.ip='someip'. The problem is that if there is a
record that have the c.id=i.conf_id but an ip different than
localhost, my query will still return the corresponding c.id and I
don't want that.
I tried something like that but couldn't get it to work:
select c.id, c.conf from confs as c inner join conf_ip as i on c.id =
i.conf_id where (select i.ip from conf_ip where ip='$ip')=0

hope yo usee what I mean

Thanx in advance

Pat

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to