sql查询文章上一篇下一篇
--- 使用字符串拼接id,title SELECT *, before = ( SELECT TOP 1 (convert(varchar(36),ContentId)+'|'+Title) as aa FROM Cms_Content WHERE CreateDate > ( SELECT CreateDate FROM Cms_Content WHERE ContentId = 'E1E75C65-AD85-4DC5-A74A-AE0892BABA38' )and Status = 1 and IsDelete = 0 ORDER BY CreateDate ), after = ( SELECT TOP 1 (convert(varchar(36),ContentId)+'|'+Title) FROM Cms_Content WHERE CreateDate < ( SELECT CreateDate FROM Cms_Content WHERE ContentId = 'E1E75C65-AD85-4DC5-A74A-AE0892BABA38' )and Status = 1 and IsDelete = 0 ORDER BY CreateDate DESC ) FROM Cms_Content WHERE ContentId = 'E1E75C65-AD85-4DC5-A74A-AE0892BABA38' and Status = 1 and IsDelete = 0