Mysql_query用于自联接 [英] Mysql_query for self join

查看:62
本文介绍了Mysql_query用于自联接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中一个表的列用于其他列,所以请告诉我使用自联接或左连接...我必须使用另一个colum id中的第一个coloum id因为它在其中使用了.. pls

i have one table, and one of the colum of the table is used in other column so pls let me know to use self join or left join in it... i have to use ones 1st coloum id in another colum id as it id used in it.. pls

推荐答案

它与任何其他连接相同。尝试

It's the same as any other join. Try
SELECT * 
FROM table1 t1
LEFT JOIN table1 t2 ON t1.parent_id = t2.id


这篇关于Mysql_query用于自联接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆