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: can this be done more elegant?

Re: can this be done more elegant?

From: <willemreinders_at_gmail.com>
Date: 19 Apr 2006 23:37:33 -0700
Message-ID: <1145515053.317295.82880@e56g2000cwe.googlegroups.com>


This works elegantly if you only want a grouped result, for instance (in my example):

WITH r_curvs AS (SELECT * FROM test_ride WHERE event_type='curve_R') SELECT MAX(time)
FROM r_curvs;

If you want the whole record, you end up with

WITH r_curvs AS (SELECT * FROM test_ride WHERE event_type='curve_R') SELECT *
FROM r_curvs
WHERE time = (SELECT MAX(time) FROM r_curvs;

which is only semantically more elegant (you don't have to write out the select twice). I doubt however if the parser handles this more efficient than my example. Received on Thu Apr 20 2006 - 01:37:33 CDT

Original text of this message

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