GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Mainframe  >  DB2

 Print  |  
Question:  What techniques are used to retrieve data from more than one table in a single SQL statement?

Answer: Joins, unions and nested selects are used to retrieve data.


December 12, 2005 09:20:50 #2
 Azahar   Member Since: Visitor    Total Comments: N/A 

RE: What techniques are used to retrieve data from mor...
 

EXEC SQL                                            
 
   SELECT                                         
      A.EMP_ID 

      ,B.WAGE                                     
    FROM                                            
      Table1 A,                                    
      Table2 B                                 
    WHERE                                           
      A.EMP_ID     = 100001                  
    
END-EXEC.    

This is an example of a simple join query

                                      

     

 

Back To Question