Advertisement
ExaGridDba

12c: 2+2=3

May 30th, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. [oracle@stormking cdb12102 partition]$ sqlplus /nolog @ conn.u.sql
  2.  
  3. SQL*Plus: Release 12.1.0.2.0 Production on Wed Jun 1 00:18:26 2016
  4.  
  5. Copyright (c) 1982, 2014, Oracle. All rights reserved.
  6.  
  7. Connected.
  8. SQL> host cat results4.sql
  9. drop table t ;
  10. create table t (
  11. p number,
  12. i number
  13. )
  14. partition by list (p) (
  15. partition p3 values (3),
  16. partition p4 values (4)
  17. );
  18.  
  19. insert into t ( p, i) values ( 3, 3 );
  20. insert into t ( p, i) values ( 4, 4 );
  21.  
  22. select distinct p "2+2=" from t where i = ( select min(i) from t where p = 2 + 2);
  23.  
  24. create index i on t (i);
  25.  
  26. select distinct p "2+2=" from t where i = ( select min(i) from t where p = 2 + 2);
  27.  
  28. SQL> @ results4.sql
  29.  
  30. Table dropped.
  31.  
  32.  
  33. Table created.
  34.  
  35.  
  36. 1 row created.
  37.  
  38.  
  39. 1 row created.
  40.  
  41.  
  42. 2+2=
  43. ----------
  44. 4
  45.  
  46.  
  47. Index created.
  48.  
  49.  
  50. 2+2=
  51. ----------
  52. 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement