inline-view

I wish I could correlate an "inline view"...

I have a Patient table: PatientId Admitted --------- --------------- 1 d/m/yy hh:mm:ss 2 d/m/yy hh:mm:ss 3 d/m/yy hh:mm:ss I have a PatientMeasurement table (0 to many): PatientId MeasurementId Recorded Value --------- ------------- --------------- ----- 1 A d/h/yy hh:mm:ss 100 1 A d/h/yy hh:mm:ss 200 1 ...

SELECTing user with earliest time and joining with other data

I have an Oracle database where I'm trying to select a user field from the earliest row (based on a time field) where certain conditions are met, and I don't know how to do it. Here's the gist of my query: SELECT id, CASE WHEN value = 'xyz' THEN 'Pending' ELSE 'Not Pending' END AS status, ti...

can oracle inline views be used across java statements instead of creating temporary table

i have a java program executing 3 separate sqls with a same inline view - it takes about 20 minutes each time to build the inline view when the sqls are executed - is there a way to cache or reuse it ? - trying to avoid temporary table solution because it needs to be delegated to a plsql since the java program does not have rights to cr...

Returning a row from a With clause

Hello im trying to make a Function that retruns a value. in my function i have this script: WITH t_new AS ( SELECT PersIDOLD, PersIDNEW, RightsMUT, SUM(gap) over(ORDER BY PersIDOLD, PersIDNEW) grp FROM ( SELECT h1.*, CASE WHEN h1.PersIDNEW = lag(h1.PersIDNEW) ...

Can I use inline views with the criteria API?

Does NHibernate support inline views using criterias? Google doesn't seem to return any relevant results. Here is the query I need to convert preferably using criterias. SELECT COUNT (incident_count) AS incident_count, SUM (total_customers) AS total_customers, MAX (longest_etr) AS longest_etr, COUNT (DISTINCT crew_c...

can't merge a union all view

I know Oracle RDMS can't merge a view that has a set operator in it. I want to know why is that. For example, this: SELECT u.* FROM ( SELECT a.a1 A, a.a2 B FROM tab_a a UNION ALL SELECT b.b1 A, b.b2 B FROM tab_b b ) u, tab_p p WHERE p.a = u.a could be transformed into this: SELECT * FROM ...