MySql教程

mysql三表查询

本文主要是介绍mysql三表查询,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

SELECT a.city,b.realname,b.address,c.goodsid FROM ims_ewei_shop_member a,ims_ewei_shop_member_address b,ims_ewei_shop_member_cart c where a.openid=b.openid and a.openid=c.openid
SELECT a.city,b.realname,b.address,c.goodsid FROM (ims_ewei_shop_member a JOIN ims_ewei_shop_member_address b on a.openid=b.openid) JOIN ims_ewei_shop_member_cart c on a.openid=c.openid 
select username,psw,gname,tel from (t1 left join t2 on t1.t1_id=t2.t1_id) left join t3 on t1.t1_id=t3.t1_id

 

SELECT a.city,b.realname,b.address,c.goodsid,d.title FROM ims_ewei_shop_member a,ims_ewei_shop_member_address b,ims_ewei_shop_member_cart c,ims_ewei_shop_member_favorite d where a.openid=b.openid and a.openid=c.openid and a.openid=d.openid
SELECT a.city,b.realname,b.address,c.goodsid,d.title FROM ((ims_ewei_shop_member a JOIN ims_ewei_shop_member_address b on a.openid=b.openid) JOIN ims_ewei_shop_member_cart c on a.openid=c.openid)  JOIN ims_ewei_shop_member_favorite d on a.openid=d.openid
select username,psw,gname,tel from (t1 left join t2 on t1.t1_id=t2.t1_id) left join t3 on t1.t1_id=t3.t1_id

这篇关于mysql三表查询的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!