August 14, 2002 at 5:22 am
I Have two tables Structure is as below
M_Brochures
(Pid
Brochures)
M_Holidays
(pid
Holidays
BrochuresXid)
now i want to pickup top 5 Holidays per brochure
can anybody give me single Sql statment for above problem
Thanks in Advance
Shrinivas L.K.
Shrinivas L.K.
August 14, 2002 at 10:41 am
select
b.brochures
, b.pid
, h.holidays
from m_brochures b
inner join m_holidays h
on b.pid = h.BrochuresXid
where h.pid in ( select top 5
h1.pid
from m_holidays h1
where h1.BrochuresXid = b.pid
)
order by b.brochures
Steve Jones
August 15, 2002 at 11:41 pm
That works Fine
Thanks Steve
Shrinivas L.K.
Shrinivas L.K.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply