Home  >  Article  >  Backend Development  >  固定广告位,刷新广告位,正常位(求优化)

固定广告位,刷新广告位,正常位(求优化)

WBOY
WBOYOriginal
2016-06-23 13:25:15992browse

select  cars.*,member.id  from (			(select * from phpcars_cars   where fidex=1 order by listorder limit  3 ) #固定广告位union 			(select * from phpcars_cars   where top>1 order by top limit  5 ) #刷新广告位union 			(select * from phpcars_cars   where top=1  order by p_addtime desc )) as cars LEFT JOIN phpcars_member AS member ON member.id = cars.uid  #正常位置

3和5都是都是变量,后台定义的,求优化。
固定广告位 是用来 固定几个位置的。
刷新广告位是用来不断给用户刷新的。


回复讨论(解决方案)

数据量比较少,暂时没发现问题。。。。

来个人接分。

你的 limit 子句能正常表现吗?

没有发现什么问题。

你的 limit 子句能正常表现吗?


可以。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn