Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | georrgetjojoStarting Member
 
 
                                        10 Posts | 
                                            
                                            |  Posted - 2007-09-13 : 12:58:05 
 |  
                                            | Hi,I am relatively new to database.The problem I am facing is that,I got two databasae tables called,'inventory' and 'temp' and the foreign key i am having is 'course_number' and i want to get all records in the 'temp' table that contains no reference to the 'inventory' table.that is the course_number which is not there in inventory table.can anyone help me with the sql query for thisThanks,George |  |  
                                    | SwePesoPatron Saint of Lost Yaks
 
 
                                    30421 Posts | 
                                        
                                          |  Posted - 2007-09-13 : 13:02:32 
 |  
                                          | select t.*from temp as tleft join inventory as i on i.cource_number = t.course_numberwhere i.course_number is null E 12°55'05.25"N 56°04'39.16"
 |  
                                          |  |  |  
                                    | georrgetjojoStarting Member
 
 
                                    10 Posts | 
                                        
                                          |  Posted - 2007-09-13 : 13:06:50 
 |  
                                          | Thank you very much.It worked. |  
                                          |  |  |  
                                |  |  |  |