Hi,
> Hi.
> I have this table (A)
> IDJOB � IDKIT
> 4 � 19
> 4 � 19
> 2 � 19
> 2 � 5
> I need to extract IDKIT with IDJOB<>2 if and only if IDKIT <> IDKIT when
> IDJOB=2
> In this case my query should return null
> With a subquery I can do this and it works
> SELECT idkit from A where A.id_job<>2 and A.id_kit not in (select
> A.id_kit from A where A.id_job=2)
Maybe you could try this query:
mysql> select distinct a1.idjob
-> from a a1 left join a a2 on a1.idkit = a2.idkit and a1.idjob <> a2.idjob
-> where a1.idjob <> 2 and (a2.idjob <> 2 or a2.idjob is null);
Regards,
Sasa
�mysql, select, database�
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php