Advertisement

04.29.2008 at 04:31AM PDT, ID: 23361647
[x]
Attachment Details

SQL Query to return rows 2-3

Asked by spartasystems in SQL Query Syntax, MS SQL Server, SQL Server 2005

Tags: MS SQL

I am running a sql query to find a list of previous advertisers, However, using the TOP 3 returns the current + 2 issues / editions / years worth but I dont want the current.

I need the Previous Advertisers, not the current and the last two publications worth

I think there was a command that allowed me to specify something like 2,2 meaning row 2 for 2 more rows?

Any help is appreciated
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
advertList.SelectSql = 
"SELECT * FROM Advert a 
WHERE Advert_PublicationId 
IN 
(SELECT Pub_c_PubId FROM Pub p 
WHERE EXISTS 
(SELECT TOP 3 null FROM Pub ph 
WHERE p.Pub_c_Reference=ph.Pub_c_Reference 
ORDER BY ph.Pub_c_PubId DESC))";
[+][-]04.29.2008 at 04:36AM PDT, ID: 21461211

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 04:39AM PDT, ID: 21461218

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 04:41AM PDT, ID: 21461227

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:00AM PDT, ID: 21461736

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:08AM PDT, ID: 21461804

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:16AM PDT, ID: 21461884

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:20AM PDT, ID: 21461929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:44AM PDT, ID: 21462160

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 06:54AM PDT, ID: 21462253

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, MS SQL Server, SQL Server 2005
Tags: MS SQL
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: B
 
 
[+][-]04.29.2008 at 07:33AM PDT, ID: 21462638

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 02:48AM PDT, ID: 21469205

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628