mysql中union的使用方法例子
来源:互联网 发布:网络文凭有用吗 编辑:程序博客网 时间:2024/06/18 05:37
/** * 获得图文回复*/ function getData($start, $limit) { $sql = "select count(*) from xx5_weixin.reply_msg"; $sql = "select count(*) from ( SELECT * FROM xx5_weixin.reply_pic_0 union all SELECT * FROM xx5_weixin.reply_pic_1 union all SELECT * FROM xx5_weixin.reply_pic_2 union all SELECT * FROM xx5_weixin.reply_pic_3 union all SELECT * FROM xx5_weixin.reply_pic_4 union all SELECT * FROM xx5_weixin.reply_pic_5 union all SELECT * FROM xx5_weixin.reply_pic_6 union all SELECT * FROM xx5_weixin.reply_pic_7 union all SELECT * FROM xx5_weixin.reply_pic_8 union all SELECT * FROM xx5_weixin.reply_pic_9 union all SELECT * FROM xx5_weixin.reply_pic_a union all SELECT * FROM xx5_weixin.reply_pic_b union all SELECT * FROM xx5_weixin.reply_pic_c union all SELECT * FROM xx5_weixin.reply_pic_d union all SELECT * FROM xx5_weixin.reply_pic_e union all SELECT * FROM xx5_weixin.reply_pic_f ) as t"; $result=db_query($sql,$this->link,__FILE__,__LINE__); list($total_row_count)=mysql_fetch_row($result); $sql = "select * from ( SELECT * FROM xx5_weixin.reply_pic_0 union all SELECT * FROM xx5_weixin.reply_pic_1 union all SELECT * FROM xx5_weixin.reply_pic_2 union all SELECT * FROM xx5_weixin.reply_pic_3 union all SELECT * FROM xx5_weixin.reply_pic_4 union all SELECT * FROM xx5_weixin.reply_pic_5 union all SELECT * FROM xx5_weixin.reply_pic_6 union all SELECT * FROM xx5_weixin.reply_pic_7 union all SELECT * FROM xx5_weixin.reply_pic_8 union all SELECT * FROM xx5_weixin.reply_pic_9 union all SELECT * FROM xx5_weixin.reply_pic_a union all SELECT * FROM xx5_weixin.reply_pic_b union all SELECT * FROM xx5_weixin.reply_pic_c union all SELECT * FROM xx5_weixin.reply_pic_d union all SELECT * FROM xx5_weixin.reply_pic_e union all SELECT * FROM xx5_weixin.reply_pic_f ) as t order by config_id asc,msg_id desc limit $start, $limit"; $result=db_query($sql,$this->link,__FILE__,__LINE__); $rows=array(); while($row=mysql_fetch_assoc($result)) { $rows[]=$row; } return array( 'rows'=>$rows, 'total_row_count'=>$total_row_count ); }
0 0
- mysql中union的使用方法例子
- mysql 中union和union的区别和使用方法
- C语言中Union类型的使用方法
- mysql 中 union 的用法
- mysql中union的使用
- mysql中union的用法
- union的使用方法
- Mysql中UNION & UNION ALL
- (转载)MySQL中UNION和UNION ALL的区别
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- xmpp digest-md5 算法 go版本
- win10不能访问共享文件夹
- ArrayList与LinkedList、TreeSet与HashSet、HashMap与LinkedHashMap之间的比较
- PYTHON FABRIC实现远程操作和部署
- P=PN?
- mysql中union的使用方法例子
- spring boot单元测试restfull API【从零开始学Spring Boot】
- test
- YOLO_tensorflow-master运行与参考记录 模型保存与运行
- 关于在idea中运行tomcat。
- 文章标题
- 改变android studio的.gradle位置的方法
- HDU5982 Relic Discovery
- 查看 PG 分布详细信息