对于多表联合查询,有人说,要用类似下面这样的语句:
SELECT *
FROM (((Member INNER JOIN MemberSort ON Member.MemberSort=MemberSort.MemberSort) INNER JOIN MemberLevel ON Member.MemberLevel=MemberLevel.MemberLevel) INNER JOIN MemberIdentity ON Member.MemberIdentity=MemberIdentity.MemberIdentity) INNER JOIN Wedlock ON Member.Wedlock=Wedlock.Wedlock
ORDER BY MemberDate DESC
我不太明白的是, 为什么要加这么多的括号???
我直接这样就可以了啊:
select uInfo.autoID,uInfo.[desc], aType.aName, bType.bName,cType.cName, dType.dName from uInfo
inner join aType on uInfo.aType = aType.aID
inner join bType on uInfo.bType = bType.bID
inner join cType on uInfo.cType = cType.cID
inner join dType on uInfo.dType = dType.dID