标签:
M:
OID
1
2
3
M_Cell:
OID MOID
1 1
2 1
3 4
Select M.OID AS M_OID,M_Cell.* From M Left Join M_Cell on M.OID=M_Cell.MOID;
此时查询出的记录数为4条记录:
M_OID OID MOID
1 1 1
1 2 1
2 null null
3 null null
Select M.OID AS M_OID,M_Cell.* From M Inner Join M_Cell on M.OID=M_Cell.MOID;
此时查询出的记录数为2条记录:
M_OID OID MOID
1 1 1
1 2 1
Select M.OID AS M_OID,M_Cell.* From M Right Join M_Cell on M.OID=M_Cell.MOID;
此时查询出的记录数为2条记录:
M_OID OID MOID
1 1 1
1 2 1
null 3 4
有这样一个需求:
M,与M_Cell为主字表关系(1:多),我们要出去M_Cell的最大
标签:
原文地址:http://www.cnblogs.com/yy3b2007com/p/4335304.html