龙空技术网

mysql 使用存储过程返回多条数据

fengyexin9 68

前言:

目前兄弟们对“mysql函数返回两个值”可能比较关心,咱们都需要剖析一些“mysql函数返回两个值”的相关资讯。那么小编在网摘上搜集了一些关于“mysql函数返回两个值””的相关资讯,希望兄弟们能喜欢,姐妹们快快来了解一下吧!

DROP procedure if EXISTS procedure_thinkn_index ;CREATE PROCEDURE procedure_thinkn_index(IN piso VARCHAR(20), IN puserId VARCHAR(80), IN page INT, IN size INT)BEGIN			select t.* from (		 select bt.think_id id, left(bt.content, 100) content,UNIX_TIMESTAMP(bt.time)*1000 time,0 type,bt.user_id userId,bt.nick_name nickName,bt.avatar,                bt.praiser_count praiseCount, bt.favor_count favorCount,bt.comment_count commentCount,bt.auths,bt.iso,                bt.bible_id bibleId,bt.bible_name bibleName,bt.book_id bookId,bt.book_name bookName,bt.chapter_id chapterId,bt.verses, '[]' tags,bt.status,0 anony                from bible_think bt where bt.status =0 and bt.audit_status = 1 and bt.user_id not in ('0biblesapp') and bt.iso = piso and char_length(bt.content) > 60						and user_id not in (select ignore_id from bible_user_ignore where user_id = puserId )		UNION			  select bp.pray_id id,left(bp.content, 100) content ,UNIX_TIMESTAMP(bp.time)*1000 time,1 type,bp.user_id userId,bp.nick_name nickName,bp.avatar,                bp.praiser_count praiseCount, bp.pray_count favorCount,bp.comment_count commentCount,bp.auths,bp.iso,                0 bibleId,'' bookName,0 bookId,'' bibleName,0 chapterId,'[]' verses, bp.tags,bp.status,bp.anony                from bible_pray bp where bp.status >= 0 and bp.audit_status = 1 and bp.iso = piso and char_length(bp.content) > 60						and user_id not in (select ignore_id from bible_user_ignore where user_id = puserId )		UNION			  select bt.trouble_id id, left(bt.content, 100) content ,UNIX_TIMESTAMP(bt.time)*1000 time,2 type,bt.user_id userId,bt.nick_name nickName,bt.avatar,                bt.praiser_count praiseCount,bt.favor_count favorCount,bt.comment_count commentCount,bt.auths,bt.iso,                0 bibleId,'' bookName,0 bookId,'' bibleName,0 chapterId,'[]' verses, '[]' tags,bt.status,bt.anony                from bible_trouble bt where bt.status =0 and bt.audit_status = 1 and bt.iso = piso and char_length(bt.content) > 60						and user_id not in (select ignore_id from bible_user_ignore where user_id = puserId )	 ) t ORDER BY t.time desc  limit page, size;	END

该接口返回多条数据

标签: #mysql函数返回两个值 #mysql插入数据并返回 #存储过程 返回