Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL question..

Re: SQL question..

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 5 Feb 2007 16:04:24 -0800
Message-ID: <1170720264.809416.289960@v33g2000cwv.googlegroups.com>


On Feb 5, 5:28 pm, redrose..._at_yahoo.com wrote:
> 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"?

If you want help you should post a create table with enough insert statements to allow someone to attempt to produce the query results you seem to be asking for.

HTH -- Mark D Powell -- Received on Mon Feb 05 2007 - 18:04:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US