Sign-up....

大家知道baidu排名,SQL怎样写吧!

baidu搜索有排名服务,如果在某段有效时间内,管理员审核通过就排到前面去,如果有效时间失效就不排前面,不过一样可以search到,请问大家,这段SQL怎样写啊?

某段有效时间:只的是客户自己提交哪一段时间可以排在前面。

我写一下字段

id 网址 有效时间 审核

1 www 生效 通过

2 hhh 生效 待审

3 aaa 失效 通过

[199 byte] By [msdn] at [2007-8-15 10:05:17]
# 1 Re: 大家知道baidu排名,SQL怎样写吧!

select * from Table

where (time between '2004-01-01' and '2004-12-31') and (checkde=1)

order by time desc

fly135 at 2006-6-3 9:04:45 >
# 2 Re: 大家知道baidu排名,SQL怎样写吧!

select * from Table

where (time between '2004-01-01' and '2004-12-31')

order by time desc

yousite1 at 2006-6-3 9:10:31 >
# 3 Re: 大家知道baidu排名,SQL怎样写吧!

order by time and 审核 desc

chinastorm at 2006-6-3 9:35:53 >
# 4 Re: 大家知道baidu排名,SQL怎样写吧!

问问上面几位,你们条件都是where (time between '2004-01-01' and '2004-12-31')

那么其他不是给钱排名的网站怎样会排在给钱的下面?

继续UP

oldwatch at 2006-6-3 10:23:13 >
# 5 Re: 大家知道baidu排名,SQL怎样写吧!

我的大概意思是给钱的排名网站能按照他们钱多少排在最前面而且一定要在生效时间内

不给钱的网站按照点击率多少来排在给钱网站的后面

网站数据都在同一个表中

我觉得这条SQL应该用UNION吧

不知道怎样写

oldwatch at 2006-6-3 10:31:39 >
# 6 Re: 大家知道baidu排名,SQL怎样写吧!

有一条SQL语句,select A as 白菜 from B ...... order by C.

我想在它后边union select A as 萝卜 from B ......order by D.

但是执行的时候出现错误.原因是union以后自动排顺序了.union 那里报错了

oldwatch at 2006-6-3 11:10:44 >

Web

All Classified