大布丁 - UCHome
type: channel
link: http://xbdsky.cn/category/uchome/
items: UCHome数据调用Sql语句大全

UCHome数据调用Sql语句大全
type: item
date: 2012-04-16T14:42:22+08:00
description: 1、调用含有图片的日志SELECT * FROM `uchome_blog` WHERE `picflag` =1;2、调用最近更新的10条日志SELECT * FROM uchome_blog FORCE INDEX(dateline) ORDER BY dateline DESC LIMIT 0,10;3、调用最近更新的10个相册SELECT * FROM uchome_album FORCE INDEX(updatetime) ORDER BY dateline DESC LIMIT 0,10;说明：这是调用所有相册加个条件：调用隐私设计为全站可见的相册SELECT * FROM uchome_album FORCE INDEX(updatetime) WHERE `friend` =0 ORDER BY dateline DESC说明：friend值： ’0′全站用户可见,’1′为全好友可见,’2′为仅指定的好友可见,’3′为仅自己可见,’4′为凭密码查看4、调用最近的10条迷你博客SELECT * FROM uchome_doing FORCE INDEX(dateline) ORDER BY dateline DESC LIMIT 0,10;5、调用我的话题SELECT * FROM uchome_thread ORDER BY dateline DESC LIMIT 0,10;6、调用3天内回复数最多的日志SELECT * FROM uchome_blog WHERE dateline>UNIX_TIMESTAMP()-86400*3 ORDER BY replynum DESC7、调用选吧一周内的热点话题select * FROM uchome_thread where dateline>=UNIX_TIMESTAMP()-604800 ORDER BY viewnum DESC;或者SELECT * FROM uchome_ thread WHERE dateline>=UNIX_TIMESTAMP()-86400*7 ORDER BY viewnum DESC;8、调用最近3天注册的人，且按照降序排列SELECT * FROM uchome_space WHERE dateline>UNIX_TIMESTAMP()-86400*3 ORDER BY dateline DESC;9、调用最后更新的10位会员select * from uchome_space order by updatetime desc LIMIT 0,10;10、将用户栏目的内容列表出来，并以用户积分作为排列顺序SELECT * FROM uchome_spacefield sf, uchome_space s WHERE s.uid=sf.uid order by s.credit desc说明：field_1为 uchome_spacefield 这个表要调用的用户栏目选择项，可以为field_1，field_2。。。11、调用个人空间性别为女的用户select * from uchome_space s,uchome_spacefield sf where s.uid=sf.uid and sf.sex=212、调用个人空间性别为男的用户select * from uchome_space s,uchome_spacefield sf where s.uid=sf.uid and sf.sex=113、调用积分高的前10个会员select * from uchome_space order by credit desc LIMIT 0,10;14、调用访问量最大的空间select * from uchome_space order by viewnum desc LIMIT 0,10;15、调用指定用户的日志SELECT * FROM `uchome_blog` WHERE uid =1 LIMIT 0 , 10这是调用uid为1的10条记录16、调用有头像的10个会员SELECT * FROM `uchome_space` WHERE `avatar` =1 LIMIT 0 , 1017、调用某一主题回复的内容SELECT * FROM `uchome_post` WHERE tid =1 AND isthread =0 LIMIT 0 , 30;上面的SQL语，可以调用主题id为1的30条回复18、调用群组SELECT * FROM `uchome_mtag` LIMIT 0 , 1019、调用一周热门会员select * from uchome_space WHERE dateline>=UNIX_TIMESTAMP()-3…