找回密码
 入住遨海湾
搜索
网站解决方案专享优惠-3折上云
查看: 1874|回复: 0

uchome 的几个数据调用的SQL语句

[复制链接]
发表于 2008-11-19 18:17:35 | 显示全部楼层 |阅读模式

登录后查才能浏览下载更多咨询,有问题联系QQ:3283999

您需要 登录 才可以下载或查看,没有账号?入住遨海湾

×
1、调用含有图片的日志 SELECT * FROM `uchome_blog` WHERE `picflag` =1; 4 `* U0 ~3 @% |# M) Q! @: X 2、调用最近更新的10条日志 SELECT * FROM uchome_blog FORCE INDEX(dateline) ORDER BY dateline DESC LIMIT 0,10; 6 [8 D9 y* }1 u5 d4 v 3、调用最近更新的10个相册 SELECT * FROM uchome_album FORCE INDEX(updatetime) ORDER BY dateline DESC LIMIT 0,10; 5 F+ a' C% v0 m! [3 Q" B说明:这是调用所有相册 / E& I3 `/ i# r U- A4 |3 i+ ^6 X加个条件:调用隐私设计为全站可见的相册 SELECT * FROM uchome_album FORCE INDEX(updatetime) WHERE `friend` =0 ORDER BY dateline DESC c& [9 G1 d( ?0 W- X% n 说明:friend值: '0'全站用户可见,'1'为全好友可见,'2'为仅指定的好友可见,'3'为仅自己可见,'4'为凭密码查看 % R) e5 y- M$ _5 u0 ?6 s $ [4 E- a" n2 w. X4、调用最近的10条播客 SELECT * FROM uchome_doing FORCE INDEX(dateline) ORDER BY dateline DESC LIMIT 0,10; 8 z3 k( j- I8 m) b 5、调用我的话题 SELECT * FROM uchome_thread ORDER BY dateline DESC LIMIT 0,10; 2 C1 ]# ?0 O/ [4 |: d6、调用3天内回复数最多的日志 SELECT * FROM uchome_blog WHERE dateline>UNIX_TIMESTAMP()-86400*3 ORDER BY replynum DESC - {9 H: `9 u1 H" o+ |7、调用选吧一周内的热点话题 select * FROM uchome_thread where dateline>=UNIX_TIMESTAMP()-604800 ORDER BY viewnum DESC; ; {$ k, n4 P5 J3 }: j 或者 SELECT * FROM uchome_ thread WHERE dateline>=UNIX_TIMESTAMP()-86400*7 ORDER BY viewnum DESC; - l7 k! }: {* p 8、调用最近3天注册的人,且按照降序排列 SELECT * FROM uchome_space WHERE dateline>UNIX_TIMESTAMP()-86400*3 ORDER BY dateline DESC; 2 L% L/ r! d4 {6 z2 b2 ] ]9、调用最后更新的10位会员 select * from uchome_space order by updatetime desc LIMIT 0,10; 1 _' i" F, V3 g" V h, E 10、将用户栏目的内容列表出来,并以用户积分作为排列顺序 SELECT * FROM uchome_spacefield sf, uchome_space s WHERE s.uid=sf.uid order by s.credit desc . e; T- D8 d2 _# n 说明:field_1为 uchome_spacefield 这个表要调用的用户栏目选择项,可以为field_1,field_2。。。$ c4 u0 `( ^3 a* W% h9 U 11、调用个人空间性别为女的用户 select * from uchome_space s,uchome_spacefield sf where s.uid=sf.uid and sf.sex=2 4 V0 s @) F' O, P* L5 a! g 12、调用个人空间性别为男的用户 select * from uchome_space s,uchome_spacefield sf where s.uid=sf.uid and sf.sex=1 3 O7 M' ?' s7 @5 X+ b( f J: f 13、调用积分高的前10个会员 select * from uchome_space order by credit desc LIMIT 0,10; / C, c4 `7 E: s0 p 14、调用访问量最大的空间 select * from uchome_space order by viewnum desc LIMIT 0,10; / @2 M j8 G. s% j( D 15、调用指定用户的日志 SELECT * FROM `uchome_blog` WHERE uid =1 LIMIT 0 , 10 $ A$ i: L( @, n3 X: C 这是调用uid为1的10条记录 3 _7 }, Z a9 y. b9 ~. s16、调用有头像的10个会员 SELECT * FROM `uchome_space` WHERE `avatar` =1 LIMIT 0 , 10 9 r. ]. T3 V3 s5 C4 N/ @17、调用某一主题回复的内容 SELECT * FROM `uchome_post` WHERE tid =1 AND isthread =0 LIMIT 0 , 30; ( ~2 T, ?. o1 H8 v 上面的SQL语,可以调用主题id为1的30条回复 , E" v; k2 n( {! S2 M0 }1 F18、调用群组 SELECT * FROM `uchome_mtag` LIMIT 0 , 10 & g4 H: b8 ~' t3 v% n2 {. J19、调用一周热门会员 select * from uchome_space WHERE dateline>=UNIX_TIMESTAMP()' ?% g. B3 I+ j3 N+ { . N5 f R" |8 b( ^% v, q' H W+ j-3600*24*7 ORDER BY viewnum DESC LIMIT 0,18 ; u: V/ j0 ]# ]. t20、调用发过帖子且有头像的会员 SELECT * from uchome_blog s,uchome_space sf where s.uid=sf.uid and sf.avatar=1
遨海湾-心灵的港湾 www.aosea.com
您需要登录后才可以回帖 登录 | 入住遨海湾

本版积分规则

网站解决方案专享优惠-3折上云

QQ|手机版|小黑屋|遨海湾超级社区

GMT+8, 2024-11-22 02:41

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表