select *from 表1 where 条件='1'
select *from 表2 where 条件>0
用左连接怎么写表达式、?????
1.创建测试表,
创建表test_col_1(id号,varvarchar2(200));
创建表test_col_2(id号,varvarchar2(200));
2.插入测试数据,
insertintotest_col_1
选择level*8, 'var'||*8 from dual connect by level <= 20;
insertintotest_col_2
选择level,‘var’||level from dual connect by level <= 100;
3.查询表A和表B中的相关记录,
Select*
fromtest_col_2b
Whereexists(select1fromtest_col_1awhereb。id=a.id)
4.查询表A中的所有数据和A、B中的相关数据,
Select*
fromtest_col_1a
unionall
Select*
fromtest_col_2b
Whereexists(select1fromtest_col_1awhereb。id=a.id)
t1 t2 是什么意思??
追答就是表1,table1,和表2,table2的别名啊,当你的表的名字很长时,用别名方便一点啊!我取得别名就是t1,t2啊,你不会连这个也不知道吧!
本回答被提问者和网友采纳