I think you can't have two ORDER BY clauses, just one in the bottom
statement.

Ade

-----Original Message-----
From: Adkins, Randy [mailto:[EMAIL PROTECTED]
Sent: 25 February 2005 20:11
To: CF-Talk
Subject: Oracle / UNION Query


Can someone point out a problem with the UNION query below.

The first error I got was "sql commdn not ended properly", so I added
a semicolor to the end but that was not it

Then I removed the semicolon and added parathesis around the top and
bottom
and then got the error "missing right parathensis"

 SELECT
   F.ID,
   F.FOLDERNAME,
   F.DISPLAYNAME,
   P.PERMISSIONTYPE
 FROM
   FOLDERS F,
   PERMISSIONS P
 WHERE
   P.MEMBERID = #SESSION.MEMBERID#
   AND P.PERMISSIONTYPE = 'F'
   AND P.PERMISSIONID = F.ID
 ORDER BY
   F.DISPLAYNAME

 UNION

 SELECT
   F.ID,
   F.FOLDERNAME,
   F.DISPLAYNAME,
   P.PERMISSIONTYPE
 FROM
   FOLDERS F,
   DOCUMENTS D,
   PERMISSIONS P
 WHERE
   P.MEMBERID = #SESSION.MEMBERID#
   AND P.PERMISSIONTYPE = 'D'
   AND P.PERMISSIONID = D.ID
   AND D.FOLDERID = F.ID
 ORDER BY
   F.DISPLAYNAME





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196626
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to