sql select语句查询的时候增加一个字段到结果里,

为了避免联表查询,需要在sql语句结果中增加一个字段:

原sql语句为:

select c.* from (select rownum as r,b.* from (select t.,t.,t.,t.,t.,t.user_id_encrypt,t.,t.create_time,t.,t.,t.,a.user_type from T_WIKI_DOC_POSTS t inner join t_wiki_user a on t.user_id_encrypt=a.user_id_encrypt where doc_topics_id_encrypt='bAAReRlFZ,X0NYX1oCA,1lDVw' order by CREATE_TIME )b where rownum<=20)c where c.r>=1

修改为:

select c.* from (select rownum as r,b.* from (select t.,t.,t.,t.,t.,t.user_id_encrypt,t.,t.create_time,t.,t.,t., 0 as user_type from T_WIKI_DOC_POSTS t where doc_topics_id_encrypt='jRANBCFgWA1FeA0BGA0AJXA**' order by CREATE_TIME )b where rownum<=20)c where c.r>=1


你可能感兴趣的:(数据库)