在内容页中调用本内容发布者的头像是这样写的:select top 1 KS_User.userface FROM (KS_User INNER JOIN KS_ItemInfo ON KS_User.UserName = KS_ItemInfo.Inputer) INNER JOIN KS_U_gyzx ON KS_ItemInfo.InfoID = KS_U_gyzx.ID where KS_ItemInfo.infoid={$CurrInfoID} and KS_ItemInfo.channelid={$CurrChannelID} 但是现在我想在栏目中的列表项中,也调用这个头像,在列中每个头像跟在这个内容标题的后面,也就是随时标题,如何写?望 高手指点 ,谢 谢了! select top 1 KS_User.userface FROM (KS_User INNER JOIN KS_ItemInfo ON KS_User.UserName = KS_ItemInfo.Inputer) INNER JOIN KS_U_gyzx ON KS_ItemInfo.InfoID = KS_U_gyzx.ID where KS_ItemInfo.infoid={$CurrInfoID} and KS_ItemInfo.channelid={$CurrChannelID} KS_ItemInfo表字段是KS_U_gyzx表子集,若在内容页调用,这个SQL冗余的,效率不高,可改成这样:
|