Thursday, 15 August 2013

oracle10g - Sql query: no rows selected -


I tried different forms of SQL statement, but I still do not have "no rows selected". I do not know where I'm going !.

Here's the question:

I have to list the titles of the conventions organized by those employees whose managers are 'Green'. / P>

The tables associated with the query are:

Employee_C Table:

  EID NAME Salary Center --- - - ---------------- ----- E01 Wilson 53000 E02 Smith 48000 E01 E03 Jones 38000 E01 E04 Loftus 41000 E05 Fox 54000 E04 E06 Smith 45,000 E04 E07 Green 48000 E08 Fox 49000 E04 E09 Wolf 41000 E04 E10 Wang 32000 E01 E11 Philips 33000 E07 E12 Liu 27000 E07   Table:  
  confid title location SDATE ------ -------------------- -------------------- - - ------ c00001 Hydroinformatics Singapore 15 Jun-12 c00002 Ecological_modeling Berlin 15-Jul-12 c00003 Computational_M London 25-May-12C00004 EcoInfo Rmatics Boston 22-Aug-12 c00005 Uncertainty_analysis Athens 10 Oct 12 c00006 Large_databases Toronto 13-APR-12 c00007 Systems_Annilalis Boston 23-March-12 c00008 Syst ems_integration Tokyo 24-FEB-12 c00009 Aquatic_biology Helsinki 12-May-12 c00010 Information_systems Paris 08 -Jan-12 c00011 Simulation_modeling Rome 01 September 12 c00012 DSS Melbourne December 18 12   

Deals_C Table:

  EID confid - - - E02 c00001 E03 c00001 E05 c00001 E06 c00001 E03 c00002 E08 c00002 E09 c00002 E10 c00002 E03 c00003 E05 C00003 e06 c00004 e08 c00005 e09 c00005 e10 c00005 e06 c00005 e11 c00006 e12 c00006 e05 c00007 e06 c00007 e08 c00007 e09 c00008 E10 c00008 e11 c00008 e 02 c00009 e12 c00009 e10 I have a SQL statement:  
  Select the C title from conference_c, where c. Choose Delska DD from D. Konfid (Choose E. Choose E.E. from Employee_C E, where E.Name = 'Green'));   

I did not select "No rows"

The problem is yours The query is that you are checking the wrong employee data. Checking your WHERE section EID on EID , when it actually checks Deals_C.EID employee. MID :

  Select the C title in the internal entry from Conferencing C (Select D. Confered, join the e-EID from DLSL-DE, Employees Edi IDEED = E.EID is where (selection from Employee_C e2 * where E2.Name = 'green' and e.mid = e2.eid)) c.CONFID = d.CONFID d   

See. The

EXISTS query is returning those rows that have the last name of green , but you Employee_C.MID Subcategories on EID .

It can also be written:

  from conference_c to c. Select the title where C Confid (Select D. Confered from DCAC DD Employee's EID = E. EID where it exists (Select from * Employee * E2, where E2.Name = 'Green' and e.mid = e2.eid)) ;   

View

No comments:

Post a Comment