Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Fun Challenge #2
> The solution is somhere here...
> I skip creating tables...
There was syntax error, sorry ...
This is runnable sql:
-- SELECT X Youngest,Y MiddleAge, Z Oldest FROM ( SELECT ROWNUM X FROM ALL_TABLES WHERE ROWNUM < 20 ), ( SELECT ROWNUM Y FROM ALL_TABLES WHERE ROWNUM < 20 ), ( SELECT ROWNUM Z FROM ALL_TABLES WHERE ROWNUM < 20 ) WHERE X * Y * Z = 36 AND X<=Y AND Y<Z AND X<Z AND (X+Y+Z) = ( SELECT X + Y + Z FROM ( SELECT ROWNUM X FROM ALL_TABLES WHERE ROWNUM < 20 ), ( SELECT ROWNUM Y FROM ALL_TABLES WHERE ROWNUM < 20 ), ( SELECT ROWNUM Z FROM ALL_TABLES WHERE ROWNUM < 20 ) WHERE X * Y * Z = 36 AND X<=Y AND Y<=Z GROUP BY X+Y+Z HAVING COUNT(*) > 1 ); -- NoelReceived on Thu Mar 04 2004 - 04:28:30 CST