
|
If you were logged in you would be able to see more operations.
|
|
|
| Planning Status: |
Unspecified
|
|
create table t1 (n integer);
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
-- ok
SQL> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );
N
============
1
-- ok
SQL> create view v1 as
CON> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );
SQL>
-- ok
SQL> select * from v1;
N
============
1
-- wrong: returns nothing
SQL> select * from v1 union all select * from v1;
|
|
Description
|
create table t1 (n integer);
insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);
-- ok
SQL> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );
N
============
1
-- ok
SQL> create view v1 as
CON> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );
SQL>
-- ok
SQL> select * from v1;
N
============
1
-- wrong: returns nothing
SQL> select * from v1 union all select * from v1;
|
Show » |
|