select * from table1 t1 inner join table2 t2 on t1.name=t2.name<br><br>--得到的结果
select * from table1 t1 (1) left join table2 t2 on t1.name=t2.name 与 select * from table2 t2 (2) right join table1 t1 on t1.name=t2.name 结果相等,不过两表的顺序换一下而已。 (1)结果 ID NAME QQ PHONE ID NAME sjsj gly 1 秦云 10102800 13500000 1 秦云 2004-01-01 00:00:00.000 李大伟 1 秦云 10102800 13500000 2 秦云 2005-01-01 00:00:00.000 马化腾 1 秦云 10102800 13500000 4 秦云 2005-01-01 00:00:00.000 李大伟 2 在路上 10378 13600000 3 在路上 2005-01-01 00:00:00.000 马化腾 2 在路上 10378 13600000 5 在路上 2005-01-01 00:00:00.000 李大伟 3 LEO 10000 13900000 NULL NULL NULL NULL 4 秦云 0241458 54564512 1 秦云 2004-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512 2 秦云 2005-01-01 00:00:00.000 马化腾 4 秦云 0241458 54564512 4 秦云 2005-01-01 00:00:00.000 李大伟 (2)结果 ID NAME sjsj gly ID NAME QQ PHONE 1 秦云 2004-01-01 00:00:00.000 李大伟 1 秦云 10102800 13500000 2 秦云 2005-01-01 00:00:00.000 马化腾 1 秦云 10102800 13500000 4 秦云 2005-01-01 00:00:00.000 李大伟 1 秦云 10102800 13500000 3 在路上 2005-01-01 00:00:00.000 马化腾 2 在路上 10378 13600000 5 在路上 2005-01-01 00:00:00.000 李大伟 2 在路上 10378 13600000 NULL NULL NULL NULL 3 LEO 10000 13900000 1 秦云 2004-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512 2 秦云 2005-01-01 00:00:00.000 马化腾 4 秦云 0241458 54564512 4 秦云 2005-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512
select * from table1 t1 right join table2 t2 on t1.name=t2.name ID NAME QQ PHONE ID NAME sjsj gly 1 秦云 10102800 13500000 1 秦云 2004-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512 1 秦云 2004-01-01 00:00:00.000 李大伟 1 秦云 10102800 13500000 2 秦云 2005-01-01 00:00:00.000 马化腾 4 秦云 0241458 54564512 2 秦云 2005-01-01 00:00:00.000 马化腾 2 在路上 10378 13600000 3 在路上 2005-01-01 00:00:00.000 马化腾 1 秦云 10102800 13500000 4 秦云 2005-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512 4 秦云 2005-01-01 00:00:00.000 李大伟 2 在路上 10378 13600000 5 在路上 2005-01-01 00:00:00.000 李大伟
select * from table1 t1 full join table2 t2 on t1.name=t2.name 结果 ID NAME QQ PHONE ID NAME sjsj gly 1 秦云 10102800 13500000 1 秦云 2004-01-01 00:00:00.000 李大伟 1 秦云 10102800 13500000 2 秦云 2005-01-01 00:00:00.000 马化腾 1 秦云 10102800 13500000 4 秦云 2005-01-01 00:00:00.000 李大伟 2 在路上 10378 13600000 3 在路上 2005-01-01 00:00:00.000 马化腾 2 在路上 10378 13600000 5 在路上 2005-01-01 00:00:00.000 李大伟 3 LEO 10000 13900000 NULL NULL NULL NULL 4 秦云 0241458 54564512 1 秦云 2004-01-01 00:00:00.000 李大伟 4 秦云 0241458 54564512 2 秦云 2005-01-01 00:00:00.000 马化腾 4 秦云 0241458 54564512 4 秦云 2005-01-01 00:00:00.000 李大伟
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有