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

Home -> Community -> Usenet -> c.d.o.misc -> How do I order by some of the rows in a column. Not all.

How do I order by some of the rows in a column. Not all.

From: Jacob Nordgren <jacob_nordgren_at_hotmail.com>
Date: 12 Oct 2001 07:22:33 -0700
Message-ID: <47c6b9be.0110120622.57febc70@posting.google.com>


Hi,

I have the following tables

PRODUCT_GROUP

ID (INT)*          'Example 1
NAME (VARCHAR)     'Example "Books"

PRODUCT
ID (INT)*          'Example: 1

PRODUCTGROUPID (INT) 'Example: 1

PROPERTY

ID (INT)*          'Example 1
NAME (VARCHAR)     'Example "Title"

PRODUCT_PROPERTY

PRODUCTID  (INT)*  'Example 1
PROPERTYID (INT)*  'Example 1
VALUE (VARCHAR)*   'Example "Learn SQL in 24 hours"

If I want to find books with titles like "SQL" I use the following query:

SELECT DISTINCT P.ID AS ID
FROM PRODUCT P, PRODUCT_PROPERTY PP
WHERE P.ID = PP.PRODUCTID
AND P.PRODUCTGROUPID = 1
AND PP.PROPERTYID = 1 AND UPPER(PP.VALUE) LIKE '%SQL%' My question is: How can I sort the result by the property "title".

Thanks for your help,

Jacob Received on Fri Oct 12 2001 - 09:22:33 CDT

Original text of this message

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