您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

〖Orz〗求一条sql语句

2025/10/29 1:23:54发布13次查看
〖orz〗求1条sql语句
想优先 rand() 出来 'phome_ecms_news' 表的 classid limit 1 (并且符合) islast(终极栏目) = 1
然后再在 表 'phome_enewsclass' 里面进行 rand() limit 1
下面sql语句错误..不会写的情况下,只有表述一下思想了.
sql codeselect * from 'phome_ecms_news' where classid = (select classid from 'phome_enewsclass' where islast=1 rand() limit 1) rand() limit 1;
------解决方案--------------------
sql codeselect * from 'phome_ecms_news' where classid in ( select classid from 'phome_enewsclass' where islast=1 order by rand() limit 1 ) order by rand() limit 1;

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product