select fourm.*,cu.nick,su.nick as editnick from Content_Book_Ask fourm (nolock) left join Custom_User cu (nolock) on fourm.CreateUserId = cu.ID left join Sys_User su (nolock) on fourm.EditUserId = su.ID where (fourm.IsApproved = 1 and fourm.IsDeleted = 0 and cu.Status = 1 and cu.IsDeleted = 0 and su.Status = 1 and su.IsDeleted = 0) order by fourm.displayorder desc
fourm.EditUserId = 0是暂时没有的,但是要链表查询的话,fourm.EditUserId = 0 的所有数据都查不到!怎么查呢?
先将fourm.EditUserId = 0 的所有数据都查出来,作为一个数据表,然后再多表连接进行查询。