Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL question..
I want to find out the phone and fax for all employees who work at a
certain address.. but I don't know if the db is configured to give me
this information easily.
RESULTS.NAME is the name of the field ex) "Address" and RESULTS.VALUE is the actual value ex) "5 Lincoln Ave"
A typical record has more than 1 RESULTS.VALUE (555-555-5555, 457-457-4577, 1 ABC street) each with their own individual RESULTS.NAME (phone, fax, address etc..)
SELECT RESULTS.ID, RESULTS.VALUE, RESULTS.DATE_ENTERED, PROJECTS.PROJECTID, RESULTS.NAME FROM RESULTS, PROJECTS WHERE (PROJECTS.PRODUCT = 'DT') AND (RESULTS.DATE_ENTERED < {ts '2007-02-05 10:13:00'}) AND (RESULTS.VALUE = '5 Lincoln Ave') AND (RESULTS.NAME ='phone') AND (RESULTS.NAME = 'fax') AND (RESULTS.ID = PROJECTS.ID) ORDER BY RESULTS.ID ASC (doesn't work)
This query brings up nothing because the RESULTS.NAME and RESULTS.VALUE don't coincide. Is there a way to get several RESULTS.VALUE's for several RESULT.NAME's for all records matching the case where RESULT.VALUE = "5 lincoln ave"? Received on Mon Feb 05 2007 - 16:28:04 CST
![]() |
![]() |