drop table t1;
create table t1 (c1 char(2) primary key, c2 char(1) not null);
insert into t1 values ('A ','A');
select t1.c1 from t1
where t1.c1 in (select c2 from t1 union all select '0'||c2 c2 from t1);
select /*+ full(t1) */ t1.c1 from t1 where t1.c1 in (select c2 from t1 union all select '0'||c2 c2 from t1); 1st query returns no row, 2nd query return 'A'

本文详细介绍了使用SQL语言进行表的删除、创建、插入及复杂查询的方法,包括使用UNION ALL进行多表查询并筛选特定数据,展示了SQL在数据处理中的强大能力。
747

被折叠的 条评论
为什么被折叠?



