<java-digest elide>

On 04-Jul-01 Asha Ramaiah wrote:
> Hey! guys!
> 
> I wanted a little help on the following : ..
> 
> Scenario:
> I have 2 tables : one task and the other tasksequence
> 
> desc task  : (primary key taskId, varchar taskdesc) 
> desc tasksequence (primary key (taskId,milestoneId))
> 
> Now the query I want to form should give me a list of all taskIds in table
> task
> excluding the taskIds frm tasksequence..( a result set of >15 rows(taskIds))
> 
> Can somebody help me with this ??...I have developed a quick fix for this :
> 
> -- capture the resultset of all the taskIds in tasksequence , as a string 
> 
> --and then :  "select taskId from task where taskId not in (taskIdsString)"
> 
> Its working , but is the same not possible with left/right or natural

Start reading the manual, pay attention at:

"If there is no matching record for the right table in the ON or USING part in
a LEFT JOIN, a row with all columns set to NULL is used for the right table.
You can
     use this fact to find records in a table that have no counterpart in
another table: 

     mysql> select table1.* from table1
                LEFT JOIN table2 ON table1.id=table2.id
                where table2.id is NULL;

"

stop reading.

-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

---------------------------------------------------------------------
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

Reply via email to