How do I select an item to appear as the 2nd last most ordered item on a list is this possible.
This is the SQL which retrieves the data that i wish i just wish to alter the ORDER BY statment so instead of displaying at the top it apperars 2nd from last.
I will loop through this query creating some HTML table structure based on the result.
CREATE PROCEDURE [dbo].[usp_CategoryTabs]
@SectionID int,
@Sitemask int
AS
SELECT
SectionID,
SectionName
FROM
tblSections
WHERE
(SiteMask & @Sitemask > 0) AND (Tab = 1)
ORDER BY CASE WHEN SectionID = @SectionID THEN 0 ELSE 1 END
thanks for your time
Angus
-Gus
This is the SQL which retrieves the data that i wish i just wish to alter the ORDER BY statment so instead of displaying at the top it apperars 2nd from last.
I will loop through this query creating some HTML table structure based on the result.
CREATE PROCEDURE [dbo].[usp_CategoryTabs]
@SectionID int,
@Sitemask int
AS
SELECT
SectionID,
SectionName
FROM
tblSections
WHERE
(SiteMask & @Sitemask > 0) AND (Tab = 1)
ORDER BY CASE WHEN SectionID = @SectionID THEN 0 ELSE 1 END
thanks for your time
Angus
-Gus