日期:2014-05-17 浏览次数:20523 次
select distinct top 10 a.title,address,meetRemark,city,star,a.id,a.pic,a.meetPic
from hotel a,meet b,mprice c
where a.id>
(select max(id)
from (select distinct top 10 a.id from hotel a,meet b,mprice c
where a.isDel=0 and a.id=b.hid and b.id=c.mid) as tblTmp)
and a.isDel=0 and a.id=b.hid and b.id=c.mid
order by a.id asc
CREATE TABLE #hotel(id INT, isDel INT, title VARCHAR(10), [address] VARCHAR(10), city VARCHAR(10), star INT)
INSERT #hotel(id,isDel) SELECT 1, 0
CREATE TABLE #meet(id INT, hid INT)
INSERT #meet SELECT 1, 1 UNION ALL SELECT 1, 2
CREATE TABLE #mprice(mid INT)
INSERT #mprice(mid) SELECT 1
SELECT DISTINCT TOP 10
a.title ,
address ,
--meetRemark ,
city ,