Mysql如何查询数据关联?

Mysql如何查询数据关联?,第1张

select * from 表名 where toId in(select fromId from 表名 where toId = 3) or toId = 3

select * from 表名 where toId in((select fromId from 表名 where toId = 3), 3)

内关联 inner join

左关联 left join

右关联 right join

交叉关联 cross join

语法为:

select *

from a inner join b

on a.xx=b.xx

where XXX


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7584438.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-07
下一篇 2023-04-07

发表评论

登录后才能评论

评论列表(0条)

保存